Topic: Broken rails?

I think I somehow broke rails . . . if I go to localhost:3000 it shows the default page, but if I go to anything else, I get a blank white page, and this shows in the webrick log: - - [04/Sep/2006:11:58:53 CDT] "GET /say HTTP/1.1" 200 0
- -> /say
[2006-09-04 11:58:53] ERROR MissingSourceFile: no such file to load -- irb
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:140:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:56:in `require_or_load'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:30:in `depend_on'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:85:in `require_dependency'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:98:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in `const_missing'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:75:in `reset_after_dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:46:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:115:in `handle_dispatch'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:81:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/webrick_server.rb:67:in `dispatch'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'

Last edited by mixmanner (2006-09-04 13:08:06)

Re: Broken rails?

Do you have two ruby installations perhaps? One at /usr/lib/ruby and one at /usr/local/lib/ruby? This is just a guess, but maybe your are calling script/server on the wrong installation. Check if the /usr/local/bin path is set in ~/.bash_profile file. Mine looks like this:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

If none of this rings a bell, then I'm probably way off so just ignore me.

Last edited by ryanb (2006-09-04 13:39:43)

Railscasts - Free Ruby on Rails Screencasts

Re: Broken rails?

I don't appear to have two ruby installations, and as for my .bash_profile:

# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/login.defs
#umask 022

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
    . ~/.bashrc

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then

Re: Broken rails?

Bear in mind although I use linux, I use it in a fairly superficial way (I'm learning).  In /usr/bin I have "ruby" (it's in blue, which means it's a symlink?), and I have an executable "ruby1.8".  Is that the way it should be?  I'm using a relatively fresh install of Ubuntu, so it should all be in order, but maybe not?

Re: Broken rails?

Have you changed environments.rb and not restarted your server?

Last edited by shadow (2006-09-04 18:12:43)

Re: Broken rails?

Success!  Again, because I'm still relatively new to linux I'm not exactly sure what was wrong, but I think you were right about there being multiple versions of Ruby.  I went through and removed all traces of ruby, reinstalled it, and now it seems to work fine.  Although, now I have to type "ruby1.8" rather than "ruby".

I'm a little fuzzy on the difference between a hard link and and symbolic link, which one should I use?

Re: Broken rails?

Here you go - some info about Symbolic Links -

Re: Broken rails?

I'd read several explanations of hard and symlinks, but this is the first that explained it contextually so I could understand it.  Much thanks smile