After updating Active Admin from the gregbell/active_admin repo so it works with rails > 4.1, I get this error when I start my rails app.
undefined method `setup' for Devise:Module (NoMethodError)
The setup method is used in the devise initalizer file in the initializer folder.
Whats causing this error?
After some digging around I found this commit
Make devise soft dependency
This means that I had to add devise to my own gem file. I had removed it because activeadmin installed devise as an dependency.
Solution
Gemfile
gem 'devise', '~> 3.2'
Related
I have a strange error in my rails project. I use ruby 2.1.1#rails4.1.1 and recently added a gem "tinymce-rails".
Everything was working fine until this gem was added. I can't turn on my server in development mode nor production.
The error is:
NoMethodError: undefined method `new' for #<Grease::Adapter(Less::Rails::ImportProcessor):0x0000000702fce0>
(in /mnt/c/repo/intratur/app/assets/stylesheets/application.css)
Please help me!, I don't what to do!
Grease gem dependency is only for "less-rails" greater or equal to 3.0.0. You can set the gem version to less than 3.0 to resolve it.
Reference: undefined method `new' for #<Grease::Adapter(Less::Rails::ImportProcessor)
I'm trying to use devise security extension as it has the exact methods I'm looking for for my project.
I've followed all the instructions on the github page: https://github.com/phatworx/devise_security_extension, but when I try to run my project I get this error message:
/home/felipe/ruby-example-2.4.1/ball-consulta-de-notas-fiscais/vportal/config/initializers/devise.rb:285:in block in <top (required)>': undefined methodexpire_password_after=' for Devise:Module (NoMethodError)
I've added the method :password_expirable to my user.rb and uncommented the line # Should the password expire (e.g 3.months)
config.expire_password_after = 2.months on my devise.rb
I'm running rails 5.0.
Can you please help me?
You don't have devise_security_extension in your Gemfile.lock, also there is no gem 'devise' in your Gemfile as well.
So, just add two lines gem 'devise' and gem 'devise_security_extension' to your Gemfile. Then repeat actions from documentation:
Devise
Devise Security Extension
Hope this will help you!
I started learning Ember.js using Rails as back-end, and created a test project. So, first I removed turbolinks from app and added the following gems to Gemfile:
gem 'ember-rails'
gem 'ember-source', '~> 1.8.1'
gem 'emblem-rails'
and bundled them. Next, I ran
$ rails g ember:bootstrap -n App --javascript-engine js
and it has returned me the following error:
/home/alex/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/emblem-rails-0.2.2/lib/emblem/rails/engine.rb:7:in
`block in <class:Engine>':
undefined method `register_engine' for nil:NilClass (NoMethodError)
Is the problem that something can be deprecated? I'm following the tutorial written in 2014.
The trouble was caused by emblem-rails gem - I commented it out, and everything worked
I'm very new to Rails, and I'm trying to build a user authentication system with 'devise', but I am failing. I'm following Rails Girls Guides's tutorial on adding authentication using the gem 'devise'. Once I got to step 5, which is to set up the User model, I received this error after running rake db:migrate
rake aborted!
NoMethodError: undefined method `merge!' for #<ActionDispatch::Routing::Mapper::Scope:0x007fd3397a7448>
/Users/.rvm/gems/ruby-2.1.2/gems/devise-3.0.4/lib/devise/rails/routes.rb:420:in `ensure in with_devise_exclusive_scope'
/Users/.rvm/gems/ruby-2.1.2/gems/devise-3.0.4/lib/devise/rails/routes.rb:420:in `with_devise_exclusive_scope'
/Users/.rvm/gems/ruby-2.1.2/gems/devise-3.0.4/lib/devise/rails/routes.rb:233:in `block (2 levels) in devise_for'
/Users/.rvm/gems/ruby-2.1.2/gems/devise-3.0.4/lib/devise/rails/routes.rb:336:in `block in devise_scope'
Has anyone solved this error? I've looked at all solutions such as not generating user model before installing devise, running bundle install, running rails g devise:install, and more. Nothing has worked so far when I'm trying to use devise for Rails 4.0.
Also, does anyone have recommendations on what tutorials I can follow to build an authentication system? I've tried a lot so far, and none has worked.
This looks to be a know bug with prior 3.4.0 devise.
Upgrading it should make this error go away.
To do that edit your Gemfile where you have gem "devise" <might have some other stuff in front> and change it to gem "devise", '~> 3.4.1'
then run bundle update devise and you are done.
Error:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/devise-1.0.11/lib/devise.rb:89:in '': undefined method 'weeks' for 2:Fixnum (NoMethodError)
That error is thrown whenever I try to run 'rails g devise:install' in a rails project I've been working on.
Any ideas?
P.S. requiring gem 'devise' in Gemfile and running bundle install to get the devise gem
This issue was already dealt with here. Try updating to a later devise version to fix.