# Ruby on Rails on Linux - Any suggestions/Help?

**URL:** <https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944>\
**Category:** Rails\
**Created:** [May 8, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944 "2006-05-08T21:42:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jentgen\_Georges\_jr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Jentgen\_Georges\_jr](https://www.ruby-forum.com/u/Jentgen_Georges_jr)\
**Post date:** [May 8, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944/1 "2006-05-08T21:42:53Z")

</div>

Hi, I’m really new to RoR and I’m trying to setup a development or even  
production server for Ruby on Rails.

I’m trying to do it on Linux Debian, but somehow, I always get this  
Error:

Application Error - Rails application failed to start properly

This was running on Debian Linux, Apache2, Mysql and FastCGI.

The Tutorial I used:  
[http://o9y.net/archives/2006/02/17/ruby-on-rails-mittels-mod\_fcgi-fur-apache](http://o9y.net/archives/2006/02/17/ruby-on-rails-mittels-mod_fcgi-fur-apache)  
-2-unter-debian/ (German)

Well, I installed everything as described in one of those many tutorials  
on  
the net, but I don’t get it to work.

Maybe someone has some tips I schould do to get it work? Or maybe  
someone  
might tell me what Setup might be the best on Linux???

I always worked with Debian, but I could switch to any other if someone  
tells me which might be the best for this task.

Thanks

-Georges

---

<div class="post-metadata">

**Author:** ![Jentgen\_Georges\_jr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Jentgen\_Georges\_jr](https://www.ruby-forum.com/u/Jentgen_Georges_jr)\
**Post date:** [May 8, 2006, 9:46pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944/2 "2006-05-08T21:46:04Z")

</div>

Check your logs, development.log for rails and the apache logs. Try  
your app in webrick.

~ Ben

On 5/8/06, Jentgen Georges jr. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Application Error - Rails application failed to start properly
> 
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
Ben R.  
303-947-0446  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![Jentgen\_Georges\_jr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Jentgen\_Georges\_jr](https://www.ruby-forum.com/u/Jentgen_Georges_jr)\
**Post date:** [May 8, 2006, 10:31pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944/3 "2006-05-08T22:31:27Z")

</div>

Well,

It seems that there might be a problem with my FastCGI installation for  
Apache. This is in my log/error.log from my rails Project:

FastCGI: incomplete headers (0 bytes)

ruby 1.8.2 (2005-04-11) [i386-linux]  
Rails 1.1.2

-Georges

---

<div class="post-metadata">

**Author:** ![Jentgen\_Georges\_jr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Jentgen\_Georges\_jr](https://www.ruby-forum.com/u/Jentgen_Georges_jr)\
**Post date:** [May 9, 2006, 8:25am UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944/4 "2006-05-09T08:25:13Z")

</div>

Jentgen Georges jr.  
escribió:\> Rails 1.1.2  
Hi Georges,

I use Debian/testing (2.6.8-2-386) and I have a protocol to set up an  
application with virtual hosts (Apache) Is in spanish (don’t have too  
much time in this moment to translate it, sorry) see it attached below:

1. Tomamos como ejemplo el tutorial Four days on rails

2. Como root en /var/www/:  
#rails ToDo

3. Con el phpnyadmin creamos la base de datos ‘todos’ y la tabla  
‘categories’

4. En /var/www/ToDo/ (de ahora en adelante ~/ToDo) hacemos:  
#ruby script/generate scaffold category

5. Editamos ~/ToDo/config/database.yml y ponemos:

6. Editamos ~/ToDo/public/.htaccess y quitamos el símbolo ‘#’ de las  
líneas sgtes.:

7. En /etc/apache2/sites-available/default introducimos al final:

8. En /etc/apache2/apache2.conf quitamos el símbolo ‘#’ de la línea:

9. No olvidar reiniciar el servidor apache cuando hagamos cualquier  
cambio:

10. No olvidar añadir en /etc/hosts el nombre del nuevo host (todos) y  
tampoco de los permisos en /var/www/todos/ de forma: chmod -R 777 \*  
/todos

Hope this helps

Antonio

---

<div class="post-metadata">

**Author:** ![Jentgen\_Georges\_jr](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47774/32.png) [@Jentgen\_Georges\_jr](https://www.ruby-forum.com/u/Jentgen_Georges_jr)\
**Post date:** [May 9, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-on-linux-any-suggestions-help/59944/5 "2006-05-09T14:55:09Z")

</div>

On Mon, May 08, 2006 at 09:39:48PM +0200, Jentgen Georges jr. wrote:  
} Hi, I’m really new to RoR and I’m trying to setup a development or  
even  
} production server for Ruby on Rails.  
}  
} I’m trying to do it on Linux Debian, but somehow, I always get this  
Error:  
}  
} Application Error - Rails application failed to start properly  
}  
} This was running on Debian Linux, Apache2, Mysql and FastCGI.

Apache2 does not play nicely with mod\_fastcgi. You need mod\_fcgid.  
Conveniently, this involves just apt-get install libapache2-mod-fcgid.

} The Tutorial I used:  
}  
[http://o9y.net/archives/2006/02/17/ruby-on-rails-mittels-mod\_fcgi-fur-apache-2-unter-debian/](http://o9y.net/archives/2006/02/17/ruby-on-rails-mittels-mod_fcgi-fur-apache-2-unter-debian/)  
(German)  
[…]

I don’t know German, I’m afraid, but it appears that the tutorial is  
having  
you build mod\_fastcgi yourself. I’m not sure why, since it is available  
precompiled as a Debian package. More to the point, it doesn’t work  
particularly well with Apache2.

} Maybe someone has some tips I schould do to get it work? Or maybe  
someone  
} might tell me what Setup might be the best on Linux???

Apache2 is fine. Debian is great. MySQL… eh, to each his own. FastCGI  
is  
a good choice in other environments, but you need mod\_fcgid. A quick  
Google  
search for mod\_fcgid and rails gives a number of pages with useful  
information. That said, here’s what I have in  
/etc/apache2/sites-available/default (note that this is for an app  
running  
at a path on a main server rather than as its own virtual host, as shown  
on  
the Alias line):

 DefaultInitEnv RAILS\_ENV production Alias /bookmarkfeeds /home/gss/work/ruby/bookmarkfeeds/public Options ExecCGI +FollowSymLinks AllowOverride All order allow,deny allow from all RedirectMatch ^/bookmarkfeeds/$ /bookmarkfeeds/feeds/ RedirectMatch ^/bookmarkfeeds$ /bookmarkfeeds/feeds/ 

Note that those last two RedirectMatch lines are specific to my app, and  
don’t apply in general. And yes, I am running it out of my home  
directory,  
because I feel like it. In addition, I had to modify the  
RAILS\_ROOT/public/.htaccess file to change the following two lines (they  
are not contiguous in the file):

AddHandler fastcgi-script .fcgi  
RewriteRule ^(.\*)$ dispatch.cgi [QSA,L]

…to…

AddHandler fcgid-script .fcgi  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

Finally, since I have this running at /bookmarkfeeds instead of at / I  
needed this line in the .htaccess file as well:

RewriteBase /bookmarkfeeds

} I always worked with Debian, but I could switch to any other if  
someone  
} tells me which might be the best for this task.

There will always be people who think that their system is better than  
yours. I can assure you that it is possible and even moderately easy to  
get  
mod\_fcgid working with Rails and Apache2 under Debian. I’ve done it. I  
have  
it running on my own machine.

} Thanks  
} -Georges  
–Greg
