5

Is there a way to get Devise to work with Rails 4.0rc1? I get the following error when trying to start the rails server or even to generate the Devise views:

/Users/scott/.rvm/gems/ruby-2.0.0-p195@rails/gems/activemodel-4.0.0.rc1/lib/active_model/deprecated_mass_assignment_security.rb:14:in `attr_accessible':
`attr_accessible` is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add `protected_attributes` to your Gemfile to use old one. (RuntimeError)
at.
  • 50,922
  • 104
  • 292
  • 461

2 Answers2

6

You can use a new Devise version that supports Rails 4.

gem 'devise', '~> 3.0.0.rc'
Ilya Khokhryakov
  • 3,686
  • 1
  • 19
  • 22
  • I added that line, ran `bundle install` and tried again to both start the rails server and generate devise views. Same issue, only now I **also** get this warning: `[DEVISE] Devise.use_salt_as_remember_token is deprecated and has no effect. Please remove it.` – at. May 20 '13 at 16:24
  • @at. can you try running `bundle update` instead of `bundle install`? – Ilya Khokhryakov May 20 '13 at 16:31
  • `bundle update` didn't actually update anything. So naturally the same issue came up – at. May 20 '13 at 16:34
  • Remove devise.rb in initializers, then run devise:install again. – Alex May 21 '13 at 15:32
  • @FancyDancy - I did that and I get `/Users/scott/.rvm/gems/ruby-2.0.0-p195@rails/gems/railties-4.0.0.rc1/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated': Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #]> (RuntimeError)` – at. May 21 '13 at 16:34
  • @at. did you run devise model generator (e.g. `rails g devise User`) using the previous version? If so, you might need to remove `attr_accessible`s from model. – Ilya Khokhryakov May 21 '13 at 17:08
  • @IlyaKhokhryakov - that seems to have gotten me 1 step further. But now none of the pages work like `/users/sign_in`. I get an error `ExecJS::RuntimeError in Devise::Sessions#new - (in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/turbolinks-1.1.1/lib/assets/javascripts/turbolinks.js.coffee)` – at. May 23 '13 at 07:46
-2

I am on the same page. I am using RoR4.0rc1 with devise~3.0.0.rc. My error looks like this:

$ rake db:migrate
rake aborted!
Rails::Application::RoutesReloader#execute_if_updated delegated to updater.execute_if_updated, but updater is nil: #<Rails::Application::RoutesReloader:0xb375220 @paths=["/var/www/html/rails/Blog/config/routes.rb"], @route_sets=[#<ActionDispatch::Routing::RouteSet:0xb3f7cd4>]>
/home/pav/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application/routes_reloader.rb:10:in `rescue in execute_if_updated'
/home/pav/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application/routes_reloader.rb:6:in `execute_if_updated'
/home/pav/.rvm/gems/ruby-2.0.0-p0/gems/railties-4.0.0.rc1/lib/rails/application/finisher.rb:69:in `block in <module:Finisher>'

Update: Removed went back in Version Control to the point before installing device. Did all steps from scratch by installing Device3.0.0rc and generating device with v3.0.0rc. Everything worked.

Midnight Coder
  • 721
  • 1
  • 8
  • 20
  • 1
    Update: Removed went back in Version Control to the point before installing device. Did all steps from scratch by installing Device3.0.0rc and generating device with v3.0.0rc. Everything worked. – Midnight Coder May 23 '13 at 15:01