1
votes

I'm running into this error after installing rails 5.0.0 on my project. I'm starting to think it's Devise gem or something. I tried multiple ways, but can't seem to figure it out. I've tried this for devise gem, but same result.

gem 'devise', :github => 'plataformatec/devise', :branch => 'master'

DEPRECATION WARNING: alias_method_chain is deprecated. Please, use Module#prepend instead. From module, you can access the original method using super. (called from <top (required)> at /home/nitrous/code/uvesty/config/environment.rb:5)
Exiting
/home/nitrous/code/uvesty/.bundle/gems/actionpack-5.0.0/lib/action_dispatch/middleware/stack.rb:108:in `assert_index': No such middleware to insert after: ActionDispatch::ParamsParser (RuntimeError

I also thought I might need to change all my

@user = User.find(params[:id])

to

@user = User.find_by(id: params[:id])
2
may be it will help you github.com/lassebunk/gretel/issues/65Vishal
The alias method chain bit appears to be a warning, the hard error is the but below about ActuonDispatch::ParamsParser. What makes you think devise is the problem?Frederick Cheung
I was getting some responses online saying it MAY be devise. But i just tried it without devise, and it's the same error. And you're right! It's just a WARNING, so it shouldn't make my project crash. That means my rails server isn't running because of the second line of error...which i'm stuck still in.Masud Hossain

2 Answers

0
votes

First change devise declaration in Gemfile like

gem "devise", '~> 4.0.0.rc1'

Secondly, you don't need to change this line, as find method is NOT deprecated.

@user = User.find(params[:id])

Please check what new in rails 5

0
votes

The issue was the gem rails_admin. I removed it and it's all fine now. It seems they might have not updated their gem for rails 5.0.