找不到生成器'delayed_job:active_record

时间:2018-03-08 13:36:49

标签: ruby-on-rails ruby activerecord delayed-job

我正在尝试在rails app中安装此gem:https://github.com/collectiveidea/delayed_job

按照说明,我将此添加到我的gem文件中,并运行bundle install:

gem 'delayed_job_active_record'

然后,在运行命令

rails g delayed_job:active_record

我得到了

Running via Spring preloader in process 4971
Expected string default value for '--jbuilder'; got true (boolean)
Expected boolean default value for '--markerb'; got :erb (string)
[WARNING] Please install gem 'therubyracer' to use Less.
Expected string default value for '--rc'; got false (boolean)
Expected string default value for '--helper'; got true (boolean)
Expected string default value for '--assets'; got true (boolean)
Expected string default value for '--rc'; got false (boolean)
Could not find generator 'delayed_job:active_record'. Maybe you meant 'devise:controllers' or 'active_record:model' or 'devise:form_for'

可能导致此问题的原因是什么?

这是我的gemfile以供进一步参考:

source 'https://rubygems.org'

ruby "2.1.2"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'

# gem 'puma'
gem "passenger"

# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end

group :production do
    gem 'pg'
    gem 'rails_12factor'
end

#Other 
gem 'twitter'
gem 'omniauth-twitter', :git => 'https://github.com/arunagw/omniauth-twitter.git'
gem "twitter-bootstrap-rails"
gem 'devise'
gem 'simple_form'
gem 'faker', :git => 'https://github.com/stympy/faker.git', :branch => 'master'
gem 'delayed_job_active_record'

#Pagination
gem 'will_paginate', '~> 3.0.6'
gem 'will_paginate-bootstrap'

#Cleaning up logs a bit
gem 'quiet_assets', group: :production

#Dealing w/ phone number input
gem 'phony_rails'

#Dealing w/ email inputs
gem 'email_validator'

#Dealing w/ dates
gem 'chronic'

#Dealing w/ locations
gem 'geocoder'
gem 'geokit-rails'

gem 'simple_form_extension'

#Error alerts
gem 'rollbar'

#For dashboard
gem "chartkick"
gem 'groupdate'

gem 'order_as_specified'

gem 'sendgrid-ruby'


#For billing
gem 'stripe'

gem 'fuzzy_match'
gem 'amatch'


#For media files
gem 'paperclip', :git=> 'https://github.com/thoughtbot/paperclip', :ref => '523bd46c768226893f23889079a7aa9c73b57d68'
gem 'aws-sdk', '< 2.0'


gem 'quiet_assets'

#Other 
gem 'httparty'
# gem 'watir'
# gem "watir-rails"
gem 'mechanize'

gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
#gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'spring',        group: :development


gem 'redactor-rails', github: 'glyph-fr/redactor-rails'

1 个答案:

答案 0 :(得分:3)

如果你正在使用spring,你会发现新宝石的功能并不总是可用。

在这种情况下,您应该先spring stop

spring stop
rails g delayed_job:active_record