Error Running Rails 3 Application under Phusion Passenger

I have a rails 3 application that runs without problems under WebRick
(on Ubuntu) that generates the following error in the browser when I run
under Apache2 with Phusion Passenger:

Ruby (Rack) application could not be started

Error message:

no such file to load -- bundler

Exception class:

LoadError

I have googled and found one or two posts with this problem but none
with solutions.

Backtrace:

lib/rubygems/custom_require> 29:in require' lib/rubygems/custom_require> 29:inrequire’
/usr/lib/ruby/gems/1.9.0/gems/passenger-2.2.15/lib/phusion_passenger/utils.rb
221 in setup_bundler_support' /usr/lib/ruby/gems/1.9.0/gems/passenger-2.2.15/lib/phusion_passenger/rack/application_spawner.rb 105 inblock in run’

I tried installing the bundler gem but that didn’t change anything.

Any suggestions?

Thanks

On Oct 3, 11:04 am, Mark F. [email protected] wrote:

I have a rails 3 application that runs without problems under WebRick
(on Ubuntu) that generates the following error in the browser when I run
under Apache2 with Phusion Passenger:

Ruby (Rack) application could not be started

Error message:

no such file to load -- bundler

It means you need to install Bundler.

On Oct 3, 7:57 pm, Mark F. [email protected] wrote:

Hongli L. wrote:

It means you need to install Bundler.

From my original post:

I tried installing the bundler gem but that didn’t change anything.

So if by this you mean something different or there is something
additional I need to do please specify.

Oops, sorry, totally looked over that part.

The most likely scenario is that you have multiple Ruby interpreters
installed on your system. Let’s call them Ruby A and Ruby B. When you
type ‘gem install bundler’ you probably installed Bundler into Ruby A,
but you told Phusion Passenger to use Ruby B and so the gem
installation didn’t have any effect on Phusion Passenger. Tell Phusion
Passenger to use Ruby A, or install Bundler into Ruby B.

Or, you installed Bundler without ‘sudo’ and caused it to be installed
into $HOME instead of system-wide.

Hongli L. wrote:

It means you need to install Bundler.

From my original post:

I tried installing the bundler gem but that didn’t change anything.

So if by this you mean something different or there is something
additional I need to do please specify.

Thanks

Hongli L. wrote:

The most likely scenario is that you have multiple Ruby interpreters
installed on your system.

Yea I definitely had some Ruby version hell going on.

Thanks for pointing me in the right direction.

Mark