[nuby] Can't get rails to work

S

Steve Hill

OK, I'm not a complete nuby - I've been using Ruby for almost 5 years
now. But this is my first delve into the wonderful world of web apps.

I have a stock Suse 8.0 installation, ruby 1.8, apache 1.3 and
rails-0.6.5 (from tarball) installation. I have tried installling
rails according to the README file.

Rails has gone into /usr/local/httpd/cgi-bin/rails. I couldn't find an
apache.conf file, but there was a httpd.conf file in /etc/httpd. I
have tried appending the apache conf section in the README into
/etc/httpd/httpd.conf, changing the path heads to
/usr/local/httpd/cgi-bin/rails/. I also made the whole rails directory
tree publicly readable and writable (chmod -R 777 rails). So the
section reads

<VirtualHost *:80>
ServerName rails
DocumentRoot /usr/local/htppd/cgi-bin/rails/public/
ErrorLog /usr/local/htppd/cgi-bin/rails/log/apache.log

<Directory /usr/local/htppd/cgi-bin/rails/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

I have also set the cgi-bin section to read
<Location /cgi-bin>
AllowOverride None
Options +ExecCGI +FollowSymLinks +Includes
SetHandler cgi-script
</Location>

and I have restarted Apache.
So, the basic problem is that none of the following web addresses give
me the rails spalsh page
http://rails - unknown host
http://127.0.0.1/rails - not found
http://127.0.0.1/cgi-bin/rails - forbidden

And (for example) if I try http://127.0.0.1/cgi-bin/rails I get the
following line in rails/lo/apache.log
[date] [error] [client 127.0.0.1] attempt to invoke directory as
script: /usr/local/httpd/cgi-bin/rails


What am I doing wrong please?

regards, treefrog
 
D

David Heinemeier Hansson

OK, I'm not a complete nuby - I've been using Ruby for almost 5 years
now. But this is my first delve into the wonderful world of web apps.

I have a stock Suse 8.0 installation, ruby 1.8, apache 1.3 and
rails-0.6.5 (from tarball) installation. I have tried installling
rails according to the README file.

The one thing you don't want to be bogged down with when learning a new
environment is configuration. The best way to avoid that is to go with
GEMs for installation and WEBrick as the web server.

You can learn about GEMs with http://www.rubyonrails.org/show/GemRails.

Once you have that up, you can start the WEBrick server with "cd
public; ruby dispatch.servet -a".

Then go to http://localhost:3000 -- you're on Rails!


...once you're ready to play around with Apache again, here are my
suggestions:
Rails has gone into /usr/local/httpd/cgi-bin/rails. I couldn't find an
apache.conf file, but there was a httpd.conf file in /etc/httpd.

That sounds like the one you want..
<VirtualHost *:80>
ServerName rails
DocumentRoot /usr/local/htppd/cgi-bin/rails/public/

It looks like you got httpd wrong as "htppd". Apache is not really to
good about being clear on errors like that. They often mask as
Permissions Denied.
and I have restarted Apache.
So, the basic problem is that none of the following web addresses give
me the rails spalsh page
http://rails - unknown host
http://127.0.0.1/rails - not found
http://127.0.0.1/cgi-bin/rails - forbidden

You need to add this line to your /etc/hosts file:

127.0.0.1 rails
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services


!DSPAM:415d6df1678164797017188!
 
S

Steve Hill

David Heinemeier Hansson said:
The one thing you don't want to be bogged down with when learning a new
environment is configuration. The best way to avoid that is to go with
GEMs for installation and WEBrick as the web server.

The installation seems fine - I don't have web access on my Linux box
- so I tend to take tars and unzip them
You can learn about GEMs with http://www.rubyonrails.org/show/GemRails.

Once you have that up, you can start the WEBrick server with "cd
public; ruby dispatch.servet -a".

Then go to http://localhost:3000 -- you're on Rails!

I did try that but I couldn't get it to go - could it be colliding
with the Instiki WEBrick server?
..once you're ready to play around with Apache again, here are my
suggestions:


That sounds like the one you want..


It looks like you got httpd wrong as "htppd". Apache is not really to
good about being clear on errors like that. They often mask as
Permissions Denied.


You need to add this line to your /etc/hosts file:

127.0.0.1 rails

Aha!

I will try everything you have suggested - thanks for the help

regards

Steve
 
D

David Heinemeier Hansson

I did try that but I couldn't get it to go - could it be colliding
with the Instiki WEBrick server?

Not unless you've specifically told Instiki (or some other service) to
live on port 3000. You can do ruby dispatch.servlet --help to get
information about using another than the default port, if that's where
the problem is.

What kind of error are you getting?
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top