3

I'm pulling out my hair trying to fire up a simple app on a VPS at DH.

Step 1: Created the test app

$ rails new test app

Step 2: Modified config/environment.rb:

require File.expand_path('../application', __FILE__)

if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
  ENV['GEM_PATH'] = '/home/feebzee/.gems' + ':/usr/lib/ruby/gems/1.8'
end

# Initialize the rails application
Testapp::Application.initialize!

App runs fine using webrick at port 3000. But if I let passenger load it, I get as far as the Rails Welcome Aboard page and it returns an error even at by clicking on the link to display the app environment.

I've attached the error messages below for your viewing pleasure. Thanks in advance and go RoR!!! :-)

Error message:
no such file to load -- bundler/setup

Exception class:
LoadError

Application root:
/home/feebzee/testapp



# Initialize the rails application
Testapp::Application.initialize!
#   File    Line    Location
0   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
1   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
2   /home/feebzee/testapp/config/boot.rb    6   
3   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
4   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
5   /home/feebzee/testapp/config/application.rb 1   
6   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
7   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
8   /home/feebzee/testapp/config/environment.rb 2   
9   /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
10  /usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
11  config.ru   3   
12  /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb   51  in `instance_eval'
13  /var/lib/gems/1.8/gems/rack-1.3.4/lib/rack/builder.rb   51  in `initialize'
14  config.ru   1   in `new'
15  config.ru   1   
Jdizzle Foshizzle
  • 314
  • 1
  • 3
  • 18

2 Answers2

0

Do you have the bundler gem installed for the environment you're using?

Preston Lee
  • 584
  • 1
  • 4
  • 10
0

WEBrick runs in development mode by default, but passenger runs in production mode by default.

The following config:

if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
  ENV['GEM_PATH'] = '/home/feebzee/.gems' + ':/usr/lib/ruby/gems/1.8'
end

...means you're trying to load a gem when running passenger that you're not when using WEBrick - assuming you're not specifying environment explicitly yourself.

Try running bundle install.

Russell
  • 12,261
  • 4
  • 52
  • 75