Hello,
I have tried to setup Ruby-on-rails on my debian Linux machine and can
not get it to run. Maybe someone can help.
The following was installed already:
- apache2 2.0.54 (and PHP5)
- Postgresql 8.1
Now, having the ‘unstable’ branch in my /etc/apt/sources.list I did:
apt-get install libapache2-mod-ruby
and Apache reports a “mod_ruby/1.2.4 Ruby/1.8.4” successfully. Then:
apt-get install rails
that finished without errors (installing ruby 1.8.3 on the way).
What follows gave me a deja-vu of Lotus Domino: Lots of helpful people
writing lots of helpful hints in lots of places, nicely linked to other
helpful sites - but no one willing to take over the responsibility for a
complete, consistent documentation. In detail:
This site: Peak Obsession gives an
“Apache configuration example for Apache 2” that I put into my
apache2.conf (debian equivalent to httpd.conf).
Also I configured mod_ruby according to
http://wiki.modruby.net/en/?InstallGuide
This seems to configure apache to accept .rbx files as ruby-executables,
right? (I later changed that to .rb without success.)
Now rails was installed to /usr/share/rails - in order to access this
from my DocumentRoot /var/www/ I moved that to /var/www/ruby/rails
Then apache2.conf was set up with:
<Directory /var/www/ruby/>
Options ExecCGI SymLinksIfOwnerMatch
AddHandler cgi-script .cgi
…
The tutorial nows says ‘Go to http://rails/ … and check that you get
the â??Congratulations, youâ??re on Rails!â? screen.’
You guessed right, that didn’t come up (my path being
myhost://ruby/rails).
Now I don’t see what script (index.rb? where?) should bring up this
message.
So I stepped back from getting rails to work and decided to see mod_ruby
work at first: On
http://www.rubycentral.com/book/web.html
I found a simple “hello world” script and put that into
/var/www/ruby/index.rb - but this brings up just the source code, the
same with an index.rbx .
At this point I would believe apache expected something like a:
‘AddType application … .rb’ (or .rbx …)
in a place like /etc/apache2/mods-enabled/ruby.conf .
Now ruby.load exists there and works as we have seen (LoadModule
ruby_module …) - but not ruby.conf.
Should this be added manually (alternatively in apache2.conf)?
Or does rails (on Debian) have a different way to configure apache2 to
understand what to do with .rb (or whatever ruby-)files?
Or maybe the Debian ‘rails’ package is not meant to be installed
together with mod_ruby and works only with fast-CGI?
Thanks for hints !
// Bernd