尝试通过以下方式启动我的 Rails 应用程序时出现错误rails s
:
/Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/resque-scheduler-2.0.1/lib/resque/scheduler.rb:9:in `<class:Scheduler>': uninitialized constant Resque::Helpers (NameError)
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/resque-scheduler-2.0.1/lib/resque/scheduler.rb:7:in `<module:Resque>'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/resque-scheduler-2.0.1/lib/resque/scheduler.rb:5:in `<top (required)>'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `require'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:81:in `rescue in block in require'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:66:in `block in require'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /Users/nils/Uni/Masterarbeit/TweetTracker/config/application.rb:7:in `<top (required)>'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/nils/.rvm/gems/ruby-1.9.3-p429/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
我正在使用带有 Ruby 1.9.3 的 Rails 4。在我的 Gemfile 中:
gem 'resque', "~> 2.0.0.pre.1", github: "resque/resque"
gem 'resque-scheduler'
以及相应的初始化程序:
# reestablish DB connection for the forked process within each job
Resque.after_fork do
ActiveRecord::Base.establish_connection
resque_config = YAML.load_file(Rails.root.join("config", "resque.yml"))
Resque.redis = resque_config[Rails.env]
end
# load resque config
resque_config = YAML.load_file(Rails.root.join("config", "resque.yml"))
Resque.redis = resque_config[Rails.env]
Dir[Rails.root.join("app", "jobs", "*.rb")].each { |file| require file }
require 'resque'
require 'resque/server'
# Load resque-scheduler schedule
require 'resque_scheduler'
require 'resque_scheduler/server'
Resque.schedule = YAML.load_file(Rails.root.join("config", "schedule.yml"))
我不知道在这里做什么。:/