0

I have upgaded ruby to 1.9.2, rubygems 1.5.0 and installed the latest rails 3.0.3 by following this tutorial:

http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx

But now my existing project no longer works. If I do a "ruby script/about", I get this:

<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- /Users/sneigaard/work/rails/myproject/config/../vendor/rails/railties/lib/initializer (LoadError) from <internal:lib/rubygems/custom_require>:29:in `require' from /Users/sneigaard/work/rails/myproject/config/boot.rb:45:in `load_initializer' from /Users/sneigaard/work/rails/myproject/config/boot.rb:38:in `run' from /Users/sneigaard/work/rails/myproject/config/boot.rb:11:in `boot!' from /Users/sneigaard/work/rails/myproject/config/boot.rb:110:in `<top (required)>' from <internal:lib/rubygems/custom_require>:29:in `require' from <internal:lib/rubygems/custom_require>:29:in `require' from script/about:2:in `<main>'

If I run "mongrel_rails start" I get this error:

** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require': no such file to load -- /Users/sneigaard/work/rails/myproject/config/../vendor/rails/railties/lib/initializer (LoadError) from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require' from /Users/sneigaard/work/rails/myproject/config/boot.rb:45:in `load_initializer' from /Users/sneigaard/work/rails/myproject/config/boot.rb:38:in `run' from /Users/sneigaard/work/rails/myproject/config/boot.rb:11:in `boot!' from /Users/sneigaard/work/rails/myproject/config/boot.rb:110 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require' from /Users/sneigaard/work/rails/myproject/config/environment.rb:7 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:29:in `require' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:147:in `rails' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run' from /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/bin/mongrel_rails:19:in `load' from /usr/bin/mongrel_rails:19

In script/server I have this:

#!/usr/bin/env ruby require File.expand_path('../../config/boot', __FILE__) require 'commands/server' 

I have searched and searched the net, but I can not figure this out, and my project is stuck :( Please help me.

Thank you
Søren

1
  • Do you really need 1.9.2? I do work with Rails 3 and have Ruby Enterprise Edition set up with rvm (which I strongly recommend) Commented Feb 5, 2011 at 13:43

3 Answers 3

1

it's rails server does that spit out the same error? you appear to be using rails 2 commands in rails 3. also, are all your gems loaded into 1.9.2? you have to reload everything when switching rubies.

Sign up to request clarification or add additional context in comments.

5 Comments

<pre><code>rails server</code></pre> gives me a list of options like for creating a new rails app. When you say reload everything then how would I do that?
Oh I see that "rails server" launches webrick, well it does nothing on my setup and never has, but I used to run webrick like this "ruby script/server webrick", and yes it gives me the same error.
Your ruby is still 1.8.x. Use RVM, then install ruby 1.9.2, then install ALL of your gems again, or run bundle after you upgrade to 1.9.2 properly. when you run rails server then it will work.
I have rvm installed now, but how do install all of my gems again?
if you are using rails 3, all of your gems are in the Gemfile in the RailsRoot folder, so /your/path/to/appname . to install all of the gems that your app will use just open a console and type bundle . If you are on a rails 2.3.x project, go to Rails root and type rake gems:install into console.
1

some misconfiguration with your ruby , if you type

which ruby gem environment 

and

ruby -v 

it's all coerent?

I will suggest to use RVM very very simple to setup good documentation and usefull for your buisness.

also seems that your project is still in rails 2.3.* not 3.0.* , in rails 3 thear is not a script/server script file. install rvm ruby 1.9.2 and the right gem to your project.

hope this could help.

4 Comments

which ruby /usr/local/bin/ruby
gem environment RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.9.2 (2010-12-25 patchlevel 136) [x86_64-darwin10.6.0] - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1 - RUBY EXECUTABLE: /usr/local/bin/ruby - EXECUTABLE DIRECTORY: /usr/local/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-10 - GEM PATHS: - /usr/local/lib/ruby/gems/1.9.1 - /Users/sneigaard/.gem/ruby/1.9.1 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000
ruby -v ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]
Hm that was some messy comments.. Hope you guys can make sense of them
0

I had this problem when upgrading an app from 1.8.7 to 1.9.2.
In Ruby 1.9.2, Kernel.require doesn't work like 1.8, instead it seems they want you to use Kernel.require_relative

See here for solutions that will work in both rubies

Ruby: require vs require_relative - best practice to workaround running in both Ruby <1.9.2 and >=1.9.2

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.