我有自己的宝石“RocketRuby”。我将它加载到 irb 中,它可以加载它。在早期版本中,我的 config.ru 中也有它并且它有效。
现在我再次编译并再次安装它。然后(它仍然通过将其加载到 irb 中工作)乘客崩溃并告诉我:
cannot load such file -- rocketruby (LoadError)
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
config.ru:1:in `block in <main>'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
/var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/var/lib/gems/1.9.1/gems/passenger-4.0.0.rc6/helper-scripts/rack-preloader.rb:82:in `eval'
/var/lib/gems/1.9.1/gems/passenger-4.0.0.rc6/helper-scripts/rack-preloader.rb:82:in `preload_app'
/var/lib/gems/1.9.1/gems/passenger-4.0.0.rc6/helper-scripts/rack-preloader.rb:127:in `<module:App>'
/var/lib/gems/1.9.1/gems/passenger-4.0.0.rc6/helper-scripts/rack-preloader.rb:6:in `<module:PhusionPassenger>'
/var/lib/gems/1.9.1/gems/passenger-4.0.0.rc6/helper-scripts/rack-preloader.rb:5:in `<main>'
config.ru 看起来像这样:
require "rocketruby"
require "./shop_of_one.rb"
ShopOfOne.instance
run RocketRuby::RackApplication.new
非常奇怪的是,虽然出现了这个错误,但在 irb 中require "rocketruby"
仍然有效。
有什么帮助吗?