我有一个Ruby应用程序,使用deamon-kit创建一个守护进程,每3秒运行一次cron任务。
问题是我正在尝试使用Errbit添加一些错误检查,所以这需要我:
require 'hoptoad_notifier'在我的脚本中。然而,脚本却在抱怨找不到文件?
.rvm/gems/ruby-1.9.2-p320@stitch/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- hoptoad_notifier (LoadError)令我困惑的是,当我运行
gem list | grep hoptoad_notifier我得到了
hoptoad_notifier (2.4.11)我做的另一个测试是在确保我处于正确的RVM gemset过程中之后,在相同的终端窗口上弹出irb控制台:
1.9.2p320 :001 > require 'hoptoad_notifier'
=> true
1.9.2p320 :002 >瞧,霍普托德正在装货。只有在加载我的deamon-kit守护进程时,我才会得到这个错误。
更让我困惑的是,当我查看我的请求块时:
require 'rubygems'
require 'resque'
require 'hoptoad_notifier'它在寻找rubygem和resque,而不是hoptoad_notifier?为什么,当我注释掉hoptoad时,它不会同时抱怨resque和rubygems?
发布于 2013-03-05 22:58:00
dameon kit使用bundler,所以你不需要包含rubygems。在Gemfile中包含以下行:
gem 'resque'
gem 'hoptoad_notifier'运行bundle install
并且像往常一样包含你的宝石:
require 'resque'
require 'hoptoad_notifier'这对我很管用。
https://stackoverflow.com/questions/15226290
复制相似问题