简体   繁体   中英

Error when adding Devise gem

I'm trying to add the Devise gem to a Rails app, and I'm getting a weird "no method error" when I try to run rails g devise:install . I scanned through all the other Stack posts on it, but none matched my error.

I added the following to my Gemfile:

gem 'devise'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'omniauth-linkedin'

And ran bundle install. Everything was fine.

Then I tried to install Devise authentication:

rails g devise:install

/Users/jake/Documents/Aptana Studio Workspace/
App/config/initializers/assets.rb:5:in `<top (requir
ed)>': undefined method `+' for nil:NilClass (NoMethodError)

...

Assets.rb

Rails.application.config.assets.version = '1.0'
Rails.application.config.assets.precompilerails  += %w( new_user.css )

Does anyone know why this could be happening? Thanks so much.

Might be a typo. Your code should read:

Rails.application.config.assets.precompile 

instead of:

Rails.application.config.assets.precompilerails

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM