Rails on Pair networks


#1

I’ve been looking to play about with Ruby on Rails for a while just to
see what the fuss is about and now that I have, it looks very
impressive. Unfortunately I can’t seem to get it to run on my shared web
server which is run by the hosting company pair networks (www.pair.com).

I found the handy guide on the wiki that seemed tailor made for my
problems and followed the steps…

http://wiki.rubyonrails.org/rails/pages/RailsOnPairNetworks

I can create an application, and I can view the “Welcome aboard”
starting page. When I click on the ‘About your applicationâ??s
environment’ link however, I get a red box with a 500 error in it rather
than the nice yellow box full of server info that I was expecting.

In following the wiki guide, I differed from the steps in the following
ways…

  • Software versions. I used ruby 1.8.4, gems 0.8.11 and rails 1.1.2.

  • I didn’t set up a new domain. I assumed that everything would work
    fine if I placed the app in a subdirectory of an existing domain. I’m
    not quite sure why the wiki page asks you to set up a whole new domain.
    My app is installed here… http://kupio.com/railstest/test/public/
    … and I haven’t messed with any URL rewriting stuff.

  • I didn’t fix the shebangs at the tops of the ruby scripts since they
    already had the correct path in them.

Things I did/didn’t do are…

  • I didn’t set up my database info in config/database.yml. I presumed
    that the test app would work without that, and I’d only need to do that
    once I started coding something proper.

  • I chmod +x’d the dispatch cgi scripts.

Initially there were log messages in development.log that indicated an
error. I have deleted that log file though and it does not seem to be
getting regenerated. I can’t remember what the error messages were in
the log. I know that this is unhelpful.

If anyone who understands web server configuration better than me can
help, I’d very much appreciate that help. Thanks!

  • Ian

#2

Ian Beveridge wrote:

I’ve been looking to play about with Ruby on Rails for a while just to
see what the fuss is about and now that I have, it looks very
impressive. Unfortunately I can’t seem to get it to run on my shared web
server which is run by the hosting company pair networks (www.pair.com).

I found the handy guide on the wiki that seemed tailor made for my
problems and followed the steps…

http://wiki.rubyonrails.org/rails/pages/RailsOnPairNetworks

I can create an application, and I can view the “Welcome aboard”
starting page. When I click on the ‘About your applicationâ??s
environment’ link however, I get a red box with a 500 error in it rather
than the nice yellow box full of server info that I was expecting.

In following the wiki guide, I differed from the steps in the following
ways…

  • Software versions. I used ruby 1.8.4, gems 0.8.11 and rails 1.1.2.

  • I didn’t set up a new domain. I assumed that everything would work
    fine if I placed the app in a subdirectory of an existing domain. I’m
    not quite sure why the wiki page asks you to set up a whole new domain.
    My app is installed here… http://kupio.com/railstest/test/public/
    … and I haven’t messed with any URL rewriting stuff.

  • I didn’t fix the shebangs at the tops of the ruby scripts since they
    already had the correct path in them.

Things I did/didn’t do are…

  • I didn’t set up my database info in config/database.yml. I presumed
    that the test app would work without that, and I’d only need to do that
    once I started coding something proper.

  • I chmod +x’d the dispatch cgi scripts.

Initially there were log messages in development.log that indicated an
error. I have deleted that log file though and it does not seem to be
getting regenerated. I can’t remember what the error messages were in
the log. I know that this is unhelpful.

If anyone who understands web server configuration better than me can
help, I’d very much appreciate that help. Thanks!

  • Ian

The ‘About your applictaion environment’ info only displays if it sees
you connected locally so I don’t think you have any problems there…

If you have you application in a subdirectory there are instructions in
the .htaccess, it has the following example/instruction

If your Rails application is accessed via an Alias directive,

then you MUST also set the RewriteBase in this htaccess file.

Example:

Alias /myrailsapp /path/to/myrailsapp/public

RewriteBase /myrailsapp

In your case it should be

RewriteBase /railstest/test/public/

after that try to navigate to some controller that doesn’t exist, for
example

http://kupio.com/railstest/test/public/foo

you should get a routing error…


#3

Hello,

I followed the same wiki page, as well as some info at:
http://www.lukemelia.com/devblog/archives/2005/10/08/ruby-on-rails-on-paircom-and-on-os-x/
http://creativi.st/blog/articles/2005/06/10/railing-in-subdirectories

Everything seems to be fine on my installation:
ruby --version on command line gives 1.8.4 and points to my
self-compiled installation at #!/usr/home/<pair_user_name>/bin/ruby
I can use irb
I can “talk” to the Rails installation via script/console (although it’s
killed after a few seconds of inactivity, but that’s normal)
The test page shows up nicely.

However, any request that goes via dispatch.cgi fails on an error 500.
After a lot of testing, it seems that the self-compiled version doesn’t
work as cgi, even though it does everything on command line (via ssh).

So a simple test script (outside the rails directory):

#!/usr/local/bin/ruby
puts “lala”

works fine, but

#!/usr/home/<pair_user_name>/bin/ruby
puts “lala”

gives an error 500…

Where should I be looking at?
What additional tests can I perform to find the cause?

Regards,

Pascal Van Hecke
http://pascal.vanhecke.info


#4

I followed the same wiki page

Sorry, forgot to quote for the sake of the e-mail readers, I meant the
instructions wiki page at
http://wiki.rubyonrails.org/rails/pages/RailsOnPairNetworks

The entire thread is at
http://www.ruby-forum.com/topic/62962

Regards,

Pascal Van Hecke
http://pascal.vanhecke.info