简体   繁体   中英

Gems not found with Passenger in conservative spawn mode on Mac OS X

We are using Passenger locally on Mac OS X for development.

I switched to conservative spawn mode to try to debug a problem with the MongoDB ruby driver.

However, after I did this, Passenger can no longer find my gems. I get the application failed to start page with this message:

Missing these required gems: aws-s3 >= 0.6.2 ruby-units >= 1.1.3 mongo >= 0.15.1 You're running: ruby 1.8.6.111 at /opt/local/bin/ruby rubygems 1.3.5 at /Users/look/.gem/ruby/1.8, /opt/local/lib/ruby/gems/1.8 Run rake gems:install to install the missing gems.

I definitely have these gems installed in the gem paths mentioned, and the app works in the default spawn mode.

I found this thread with the same problem on the Passenger mailing list, but there was no resolution.

Any ideas?

在environment.rb中,您必须指定lib(我想是因为gem名称中的连字符):

config.gem "aws-s3", :lib => "aws/s3"

You may want to make sure the two modes are using the same ruby/rubygems installation. Perhaps you could print out, emit, or otherwise log your load paths, which are in the variable $: (dollar colon) at some point above the gem initialization in environment.rb

Compare the output of that in the 2 modes to make sure they both include the same paths. If not, the issue is that conservative mode is picking up a different ruby/rubygems installation on your system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM