简体   繁体   中英

Error Using Phusion Passenger - Could not find sqlite3-ruby-1.2.5 in any of the sources (Bundler::GemNotFound)

I have finally got RoR set up on my server using Phusion Passenger and the default RoR applicatioon page shows, however when I click 'About your application's environment' I get an error saying 'Ruby (Rack) application could not be started' and under the Error Message bit 'Could not find sqlite3-ruby-1.2.5 in any of the sources (Bundler::GemNotFound)'.

If I do 'bundle install' at the command line I get a list of 'Using x (y)' style messages including this:

Using sqlite3-ruby (1.2.5)

(I had to downgrade to 1.2.5 due to an issue with the latest one)

I really dont understand why I am getting the error above as sqlite3-ruby is obviously there.

Stack Trace On Error Page:

0   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb    87  in `materialize'
1   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb    81  in `map!'
2   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb    81  in `materialize'
3   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/definition.rb  90  in `specs'
4   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/definition.rb  135     in `specs_for'
5   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/definition.rb  124     in `requested_specs'
6   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/environment.rb     23  in `requested_specs'
7   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/runtime.rb     11  in `setup'
8   /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler.rb     107     in `setup'
9   /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/utils.rb  326     in `prepare_app_process'
10  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/rack/application_spawner.rb   155     in `initialize_server'
11  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/utils.rb  572     in `report_app_init_status'
12  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/rack/application_spawner.rb   153     in `initialize_server'
13  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server.rb    204     in `start_synchronously'
14  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server.rb    180     in `start'
15  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/rack/application_spawner.rb   128     in `start'
16  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/spawn_manager.rb  253     in `spawn_rack_application'
17  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server_collection.rb     132     in `lookup_or_add'
18  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/spawn_manager.rb  246     in `spawn_rack_application'
19  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server_collection.rb     82  in `synchronize'
20  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server_collection.rb     79  in `synchronize'
21  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/spawn_manager.rb  244     in `spawn_rack_application'
22  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/spawn_manager.rb  137     in `spawn_application'
23  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/spawn_manager.rb  275     in `handle_spawn_application'
24  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server.rb    357     in `__send__'
25  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server.rb    357     in `server_main_loop'
26  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/lib/phusion_passenger/abstract_server.rb    206     in `start_synchronously'
27  /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/helper-scripts/passenger-spawn-server   99 

Edit:

This is my passenger.conf file.

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.6
PassengerRuby /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby
PassengerMaxPoolSize 2

You seems to have two versions(ruby-enterprise-1.8.7 and 1.9.1) of ruby runtimes installed. Make sure you install the sqlite3-ruby gem (and passenger) on the same runtime.

You have installed the passenger gem in 1.9.1 ruby runtime however you are setting the PassengerRuby to 1.8. I think you shouldn't do that. Set it to 1.9.1. And make sure you run bundle install (inside your rails project folder) with ruby 1.9.1, so that it installed all needed gems to the 1.9.1 runtime.

PassengerRuby /path/to/1.9.1/here/bin/ruby

If you want to manage different versions of ruby runtimes with ease i suggest looking at RVM

Your Passenger configuration seems wrong.. you supply the PassengerRoot of a passenger gem in your 1.9.1 universe, but point to PassengerRuby in the 1.8.7 universe.

I would advise recompiling the passenger apache module from Ruby 1.9 using passenger-install-apache2-module and change your configuration according to the instructions given by the installer.

Also, if you're using Rails I suggest you upgrade to 1.9.2 or stick with 1.8.7. Rails does not play nice with Ruby 1.9.1.

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