Swapnil
Swapnil

Reputation: 127

rails 5 Uninitialized constant RackDelegation

I am working on a project which uses rails 5.0.0.rc2. Here is what I have done till now -

  1. rails new DemoProject.
  2. created gemset for ruby-2.3.1 and rails-5.0.0.rc2.
  3. $ bundle install.
  4. $ rails g model User name:string

  5. Used devise gem.

    gem 'devise'

    $ rails generate devise:install

    $ rails generate devise User

Now, if I run rake:db migrate , I am receiving an error-

/home/swapnil/.rvm/gems/[email protected]/gems/devise-3.5.10/lib/devise/failure_app.rb:9:in `': uninitialized constant ActionController::RackDelegation (NameError)

What is the reason behind it ? How to fix this ?

Upvotes: 0

Views: 1465

Answers (4)

Abhishek Tanwar
Abhishek Tanwar

Reputation: 21

You shouldn't be using this gem with Rails 5. Rails 5 already has rails-api merged in. So rails-api (this gem) and Rails 5 are not compatible you should just remove rails-api from the Gemfile.

Upvotes: 0

Alex Levine
Alex Levine

Reputation: 1587

This was the doorkeeper gem for me, needed to be bumped

Upvotes: 0

Swapnil
Swapnil

Reputation: 127

Devise 4.0 works with Rails 4.1 onwards.

So it was a problem with version of devise.

I upgraded it so that it is now compatible with rails 5.0.0.rc2.

gem 'devise', '~> 4.1', '>= 4.1.1'

and run bundle install.

Upvotes: 0

Vlad
Vlad

Reputation: 901

By the looks of it, you're using Devise 3.5.10 which is not compatible with Rails 5.0.0.rc2 . If using the latest Devise from RubyGems doesn't work for you, do this in your Gemfile . gem 'devise', github: plataformatec/devise

Checked my Rails 5.0.0.rc1 and my Devise version is 4.1.1 .

Upvotes: 0

Related Questions