Ruby on Rails on Feisty Fawn.
Setting up
Mostly followed Four Days On Rails and RoR on Ubuntu Help.
After I have followed RoR on Debian Etch I have successfully set up the fcgi.
I have installed everything using Ubuntu packages. Nothing was installed via gem.
Installed ruby packages:
i eruby - Embedded Ruby Language i A liberb-ruby - Tiny eRuby i liberuby - Library for eruby i libfcgi-ruby1.8 - FastCGI library for Ruby i libgems-ruby1.8 - libraries to use RubyGems, a package manag i libhtml-htmltokenizer-ruby - simple HTML tokenizer/parser for Ruby i libopenssl-ruby1.8 - OpenSSL interface for Ruby 1.8 i A libpgsql-ruby1.8 - PostgreSQL extension library for Ruby 1.8 i A libreadline-ruby1.8 - Readline interface for Ruby 1.8 i A libredcloth-ruby1.8 - Textile module for Ruby 1.8 i A libruby1.8 - Libraries necessary to run Ruby 1.8 i libyaml-ruby - YAML for Ruby i libzlib-ruby - Extension library to use zlib from Ruby i rails - MVC ruby based framework geared for web ap i A rake - a ruby build program i A rdoc - Generate documentation from ruby source fi i A ruby - An interpreter of object-oriented scriptin i A ruby1.8 - Interpreter of object-oriented scripting l i ruby1.8-dev - Header files for compiling extension modul i rubygems - package management framework for Ruby libr i vim-ruby - Vi IMproved - enhanced vi editor - with Ru i libapache2-mod-fcgid - an alternative module compat with mod_fast i libfcgi0c2 - Shared library of FastCGI
Authentication
Act As Authenticated has it all.
Troubleshooting
mySQL accounts
If rake db:migrate says Access denied...
$ rake db:migrate --trace (in /home/proj/klub-goryu/goryu-is/klub-is) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! #28000Access denied for user 'matej'@'localhost' (using password: YES)
Then you have to set up the password for the particular user in the database:
$ mysql -u user
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.38-Ubuntu_0ubuntu1-log Ubuntu 7.04 distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> set password for 'user'@'localhost' = password('userspwd');
Query OK, 0 rows affected (0.10 sec)
Issues
Apache 2 + fcgi + rails
I wasn't able to make fcgi work. I keep getting the error:
ActionController::RoutingError (no route found to match "/" with {:method=>:get}):
/vendor/rails/actionpack/lib/action_controller/routing.rb:1266:in `recognize_path'
...
/home/proj/proj/app/public/dispatch.fcgi:24System works nicely without fcgi (quite slow, however).
File bug in launchpad 126263.
Solution (it was all my fault): Rewrite rule was specified twice in the .htaccess file.
Working .htaccess (as described in RoR on Debian Etch.
# General Apache options
AddHandler fcgid-script .fcgi
#AddHandler fastcgi-script .fcgi
#AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
# RewriteRule .* - [L]
# Redirect all requests not available on the filesystem to Rails
# By default the cgi dispatcher is used which is very slow
#
# For better performance replace the dispatcher with the fastcgi one
#
# Example:
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
RewriteEngine On
# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
# Alias /klub/ /home/proj/klub-goryu/goryu-is/klub-is/public/
RewriteBase /klub/
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
# In case Rails experiences terminal errors
# Instead of displaying this message you can supply a file here which will be rendered instead
#
# Example:
# ErrorDocument 500 /500.html
ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"