5

I'm a new to Ruby on Rails and I tried to do some examples from Internet. But I have an error when I'm trying to generate devise install. I modified the Gemfile by adding gem devise. Then run:

bundle install

but when I run.

rails generate devise:install

I had the next error:

/usr/local/lib/ruby/gems/0.9.1/gems/devise-1.1.3/lib/devise.rb:193:in `mailer=': undefined method `ref' for ActiveSupport::Dependencies:Module (NoMethodError)
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:195:in `<module:Devise>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/devise-1.1.3/lib/devise.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /home/mihai/Desktop/blog/config/application.rb:7:in `<top (required)>'
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `require'
    from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:24:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

Please help me!

poseid
  • 6,986
  • 10
  • 48
  • 78
23ars
  • 647
  • 3
  • 16
  • 37

3 Answers3

6

The version of Devise is rather old.

You can do:

bundle update devise

And then:

bundle install

This should upgrade the Devise gem.

poseid
  • 6,986
  • 10
  • 48
  • 78
1

you can try to put this inside your Gemfile instead of just gem 'devise'

gem 'devise', github: 'ghiculescu/devise', branch: 'patch-2'

Re-run bundle install

and then you can do rails generate devise:install

Exodus Reed
  • 177
  • 1
  • 10
0

It should be:

rails generate devise_install 

and not:

rails generate devise:install
Kypros
  • 2,997
  • 5
  • 21
  • 27
Mur
  • 1