我在 Apache 网络服务器上安装了 Passanger mod 并尝试运行我的应用程序(一个使用Rails 3.2.8
和Ruby 1.9.3-p194
)。
首先,我遇到了“bundler
找不到宝石”之类的错误。搜索了一下我找到了一个解决方案 - 我只需要将GEM_PATH
环境变量添加到我的虚拟主机。
但后来我遇到了另一个问题:几乎每个 gem 都会抛出这样的异常(Apache 错误日志):
Rack: /home/shybovycha/projects/rails/blog: symbol lookup error: /usr/local/lib/ruby/gems/1.9.1/gems/json-1.7.5/lib/json/ext/parser.so: undefined symbol: rb_intern2
*** Exception EOFError in spawn manager (Unexpected end-of-file detected.) (process 31821):
from /usr/lib/ruby/1.8/phusion_passenger/utils.rb:306:in `unmarshal_and_raise_errors'
from /usr/lib/ruby/1.8/phusion_passenger/rack/application_spawner.rb:71:in `spawn_application'
from /usr/lib/ruby/1.8/phusion_passenger/rack/application_spawner.rb:41:in `spawn_application'
from /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:159:in `spawn_application'
from /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
from /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
from /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
from /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
from /usr/lib/phusion_passenger/passenger-spawn-server:61
[ pid=31752 file=ext/apache2/Hooks.cpp:727 time=2012-08-31 12:51:47.973 ]:
Unexpected error in mod_passenger: Cannot spawn application '/home/shybovycha/projects/rails/blog': The spawn server has exited unexpectedly.
Backtrace:
(empty)
尝试重新安装 gems,有和没有--platform
选项给我什么。
注意: rails server
完美进行。
请帮我解决这个问题!