我按照步骤让rails_id在rails引擎中工作 - 发布here on github,当我执行以下操作时似乎:
s.add_dependency 'friendly_id', '~> 5.0.0'
在engine.gemspec文件中然后执行:
bundle install #=> works
rails g friendly_id #=> works
rake db:migrate
我明白了:
rake aborted!
uninitialized constant FriendlyId
嗯......什么?
module Xaaron
class Role < ActiveRecord::Base
extend FriendlyId
friendly_id :role, use: :slugged
validates :role, presence: true
validates_uniqueness_of :role
end
end