Skip navigation.

Posts tagged with "Rails"

Configure Ruby on Rails in Debian Etch

,

Packages you may need to install

ruby1.8 ruby1.8-dev rails rake rdoc1.8 irb1.8 rubygems rails 
libzlib-ruby libapache2-mod-ruby libapache-ruby1.8 
libapache-mod-fastcgi libfcgi-ruby1.8 
libmysql-ruby libpgsql-ruby


Configuration (one possible way)

mkdir /var/rails
cd /var/rails
rails myapp


Edit the file /var/rails/myapp/public/.htaccess and make the following changes:
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L] 
RewriteBase /rails


May need to change /var/rails/myapp/public/dispatch.fcgi about crash log

Edit the file /etc/apache2/sites-available/default and make the following changes:
Alias /rails/ "/var/rails/myapp/public/"
<Directory /var/rails/myapp/public/>
   Options ExecCGI FollowSymLinks
   AddHandler cgi-script .cgi
   AllowOverride all
   Order allow,deny
   Allow from all
</Directory>


Load mod_rewrite
cd /etc/apache2/mods-enabled
ln -s ../mods-available/rewrite.load rewrite.load


Restart apache2
/etc/init.d/apache2 restart


NOTE: To make your life easier, chmod 755 /var/rails/myapp/tmp

Now check http://localhost/rails/


References

Ruby on Rails on Debian