Topic: ruby script/server error

Hi all,I am new to ruby and rails so I am a complete newbie in this subject.  I have a website which needs to be restored from a crashed computer.  I believe I am close to getting the website up but I continue to encounter the same error on the "ruby script/server" command. I appreciate anyone's help with this.

The following is the output of the command

C:\rails\collections>ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails 2.1.2 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/dependenci
es.rb:279:in `load_missing_constant': uninitialized constant Collections (NameEr
ror)
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:468:in `const_missing'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:480:in `const_missing'
        from C:/rails/collections/config/initializers/secret_token.rb:7
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:503:in `load'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:503:in `load'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:355:in `new_constants_in'
        from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_suppo
rt/dependencies.rb:503:in `load'
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/initializer.rb:484:i
n `load_application_initializers'
         ... 32 levels...
        from c:/ruby/lib/ruby/gems/1.8/gems/rails-2.1.2/lib/commands/server.rb:3
9
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `ge
m_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire'
        from script/server:3

Last edited by striffa (2012-04-10 17:48:16)

Re: ruby script/server error

As you may be aware version 2.1.2 of ROR is very old.  I suspect you have a version of one of your gems that was intended for  a later version of ROR.  Take a look at your gems and see if you can find any history to see which version would be contemporary with ROR 2.1.2.

Re: ruby script/server error

thanks norm for the tip.  Is there a file that would tell me what version of each gem was used on the old computer? We were only able to backup the ruby directory and the rails project directory which holds the website. 

Also, is it possible to run this website using the latest version of ruby and gems?  I believe the version of ruby used on the previous computer was 1.8.6.

Re: ruby script/server error

I don't know how to figure out what version of the gems were used if it was not specified in the environment.rb file (take a look they may be specified there by version).  The version of ROR you specified dates from about 2007 or so.  You might be able to find info on the release dates of various versions of the gems.  I think most of the gems probably were on rubyforge at that time.  The version of ruby should not make that much difference because it does have pretty good backward compatability unlike ROR which has changed a lot since 2007.  The version of rubygems could also be a problem.

If you list the gems used some on this forum might be able to give some help.

Re: ruby script/server error

Askar I do not understand what your problem is.  It looks to me as if your server started normally and then was killed with a ^C.  Rails 2.3.11 is close to a version I have used extensively.  I use 2.3.14 which is the last of the 2.3 versions and it works well.   What is the problem you are having?

Re: ruby script/server error

I was learned about this ruby script on how to used it.Thanks!

Re: ruby script/server error

norm wrote:

Askar I do not understand what your problem is.  It looks to me as if your server started normally and then was killed with a ^C.  Rails 2.3.11 is close to a version I have used extensively.  I use 2.3.14 which is the last of the 2.3 versions and it works well.   What is the problem you are having?

Hi Norm. I'm sorry for late response.
Yes, you're right. It was not a error what I had, so I deleted my post. smile