与nginx / passenger的SQLite3问题

时间:2009-11-23 15:59:33

标签: ruby-on-rails sqlite

我正在尝试访问使用rails构建的网络应用。但是当我输入我得到的URL时: 500内部服务器错误

如果您是本网站的管理员,请阅读此Web应用程序的日志文件,以了解出现了什么问题。

在日志中有:

/!\ FAILSAFE /!\  Mon Nov 23 10:56:03 -0500 2009
Status: 500 Internal Server Error
no such file to load -- sqlite3
/opt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/opt/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
/opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/requires.rb:7:in `require_library_or_gem'
/opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/opt/ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/requires.rb:5:in `require_library_or_gem'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in `sqlite3_connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `new_connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:in `checkout'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `loop'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in `checkout'
/opt/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:in `checkout'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in `connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:in `connection'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:9:in `cache'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:28:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/failsafe.rb:26:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/vendor/rack-1.0.0-git/lib/rack/lock.rb:11:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/vendor/rack-1.0.0-git/lib/rack/lock.rb:11:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/vendor/rack-1.0.0-git/lib/rack/lock.rb:11:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:106:in `call'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/rack/request_handler.rb:95:in `process_request'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/railz/application_spawner.rb:374:in `start_request_handler'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/railz/application_spawner.rb:332:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/utils.rb:184:in `safe_fork'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/railz/application_spawner.rb:330:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:163:in `start'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/railz/application_spawner.rb:209:in `start'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.7/bin/passenger-spawn-server:61

我尝试了gem install sqlite3-ruby,apt-get也安装了很多ruby sqlite3包,但它根本不起作用总是出现同样的错误。

会出现什么问题?

谢谢!

1 个答案:

答案 0 :(得分:1)

看起来您正试图用Enterprise Ruby替换标准的Ruby / Rubygems发行版。乘客暗示这一点。但是,文档没有提到的是您无法访问当前安装的gem。

apt-get和gem的基本安装增强了Ruby的系统版本。通常位于/usr/lib/ruby

解决方案是为指向您的Enterprise Ruby安装的gem提供--install-dir选项。像这样:

$ gem install sqlite3-ruby --install-dir /opt/ruby/lib/ruby/gems/1.8

然而,随Enterprise Ruby打包的gem版本会自动执行此操作。所以这也应该可以解决问题。

$ /opt/ruby/bin/gem install sqlite3-ruby

N.B。:您将需要以这种方式安装应用程序所需的所有其他宝石。