Philip Rhoades
2012-Jul-16 07:06 UTC
After moving from Ruby 1.8.7 to 1.9.3 - test/unit/error (LoadError)
People, For my old library app I did with Rails 2.1.1, if I use Fedora 16/Ruby 1.8.6, everything is OK. If I copy the app to a Fedora 17/Ruby 1.9.3 setup and reinstall all the old Gems and run: ./script/server I get: /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'': cannot load such file -- test/unit/error (LoadError) from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `block in require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/deprecation.rb:204:in `<top (required)>'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `block in require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in `new_constants_in'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in `require'' from /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support.rb:40:in `<top (required)>'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/local/share/gems/gems/rails-2.1.1/lib/commands/server.rb:1:in `<top (required)>'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' from ./script/server:3:in `<main>'' I have found similar problems reported and so have messed around with the paths in script/server: #!/usr/bin/env ruby # $: << File.dirname(__FILE__) # $: << File.dirname(__FILE__) + ''..'' # $: << File.dirname(__FILE__) + ''../..'' # $: << File.join(File.dirname(__FILE__),''..'') # require File.dirname(__FILE__) + ''/../config/boot'' # require File.expand_path(''../../config/boot'', __FILE__) # require File.expand_path(__FILE__)+''/../../config/boot'' APP_PATH = File.expand_path(''../../config/application'', __FILE__) require File.expand_path(''../../config/boot'', __FILE__) # require ''rails/commands'' require ''commands/server'' Any suggestions? (besides writing the app from scratch in the new environment). Thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil-8eKeQ+h1VH4pAS55Wn97og@public.gmane.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
RoRroland
2012-Jul-16 09:50 UTC
Re: After moving from Ruby 1.8.7 to 1.9.3 - test/unit/error (LoadError)
Try this out: Add in your script to improve the LOAD_PATH #!/usr/bin/env ruby $: << File.dirname(__FILE__) + ''../..'' require File.expand_path(''../../config/boot'', __FILE__) require ''commands/server On Monday, July 16, 2012 3:06:14 PM UTC+8, Philip Rhoades wrote:> > People, > > For my old library app I did with Rails 2.1.1, if I use Fedora 16/Ruby > 1.8.6, everything is OK. If I copy the app to a Fedora 17/Ruby 1.9.3 > setup and reinstall all the old Gems and run: > > ./script/server > > I get: > > /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'': cannot > load such file -- test/unit/error (LoadError) > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in > > `block in require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in > > `new_constants_in'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in > > `require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/deprecation.rb:204:in > > `<top (required)>'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in > > `block in require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in > > `new_constants_in'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in > > `require'' > from > /usr/local/share/gems/gems/activesupport-2.1.1/lib/active_support.rb:40:in > `<top (required)>'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from /usr/local/share/gems/gems/rails-2.1.1/lib/commands/server.rb:1:in > `<top (required)>'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from /usr/share/rubygems/rubygems/custom_require.rb:55:in `require'' > from ./script/server:3:in `<main>'' > > I have found similar problems reported and so have messed around with > the paths in script/server: > > #!/usr/bin/env ruby > > # $: << File.dirname(__FILE__) > # $: << File.dirname(__FILE__) + ''..'' > # $: << File.dirname(__FILE__) + ''../..'' > # $: << File.join(File.dirname(__FILE__),''..'') > # require File.dirname(__FILE__) + ''/../config/boot'' > # require File.expand_path(''../../config/boot'', __FILE__) > # require File.expand_path(__FILE__)+''/../../config/boot'' > > APP_PATH = File.expand_path(''../../config/application'', __FILE__) > require File.expand_path(''../../config/boot'', __FILE__) > > # require ''rails/commands'' > require ''commands/server'' > > Any suggestions? (besides writing the app from scratch in the new > environment). > > Thanks, > > Phil. > > -- > Philip Rhoades > > GPO Box 3411 > Sydney NSW 2001 > Australia > E-mail: phil-8eKeQ+h1VH4pAS55Wn97og@public.gmane.org >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/DDL2sjJ-svQJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.
Apparently Analagous Threads
- "no such file to load -- rails/commands/runner (LoadError)"
- (Unable to start rails application) ruby scipt/server error
- Webrick script/server file does not exist
- LoadError when upgraded to latest rspec trunk
- BackgrounDRb / Testing Error: uninitialized constant BackgrounDRb