使用Phusion Passenger时出错 - 无法在任何来源中找到sqlite3-ruby-1.2.5(Bundler :: GemNotFound)

时间:2011-04-12 09:08:08

标签: ruby-on-rails ruby rubygems passenger

我终于使用Phusion Passenger在我的服务器上设置了RoR,默认的RoR应用程序页面显示,但是当我点击“关于你的应用程序的环境”时,我收到一个错误,说'Ruby(Rack)应用程序无法启动'并在错误消息位下找不到任何来源(Bundler :: GemNotFound)中的sqlite3-ruby-1.2.5。

如果我在命令行执行'bundle install',我会得到一个'Using x(y)'样式消息列表,包括:

使用sqlite3-ruby(1.2.5)

(由于最新问题,我不得不降级到1.2.5)

我真的不明白为什么我得到上面的错误,因为sqlite3-ruby显然在那里。

错误页面上的堆栈跟踪:

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 

编辑:

这是我的passenger.conf文件。

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

2 个答案:

答案 0 :(得分:3)

您似乎安装了两个版本(ruby-enterprise-1.8.7和1.9.1)的ruby运行时。确保在同一运行时安装sqlite3-ruby gem(和passenger)。

您已在1.9.1 ruby​​运行时安装了passenger gem,但是您将PassengerRuby设置为1.8。我想你不应该这样做。将其设置为1.9.1。并确保使用ruby 1.9.1运行bundle install(在rails项目文件夹中),以便将所有需要的gem安装到1.9.1运行时。

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

如果您想轻松管理不同版本的ruby运行时我建议查看RVM

答案 1 :(得分:1)

您的Passenger配置似乎有误..您在1.9.1宇宙中提供了乘客宝石的PassengerRoot,但指向1.8.7宇宙中的PassengerRuby。

我建议使用passenger-install-apache2-module从Ruby 1.9重新编译乘客apache模块,并根据安装程序提供的说明更改配置。

另外,如果您使用的是Rails,我建议您升级到1.9.2或坚持使用1.8.7。 Rails与Ruby 1.9.1不相称。