How to Install the devise 3.4.1 gemfile in Rails

rails

#1

Hello,

I am taking a course on Ruby on Rails and I am trying to do what the instructor says which is install the devise gem. However I can’t seem to get the install to work. I run:

bundle exec rails g devise:install

And I get this output instead of what the instructor says I need.
/usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
/usr/local/rvm/gems/ruby-2.3.0/gems/actionmailer-4.1.0/lib/action_mailer/base.rb:553:in method_missing': undefined methodsmtp_setting=’ for ActionMailer::Base:Class
Did you mean? smtp_settings=
smtp_settings
smtp_settings? (NoMethodError)
from /home/ubuntu/workspace/simplecodecasts_saas/config/environment.rb:7:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:inrequire’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in block in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:inload_dependency’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:92:inpreload’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:143:in serve' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:inblock in run’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in loop' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:inrun’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in

My question is what am I doing wrong? Please help.

Thanks,

Jonathan


#2

Make sure to add the Devise gem into your Gemfile file:

gem 'devise'

For specific versions use:

gem 'devise', '~> 3.4.1'

Then run bundle install to install the new gem.

Finally you can try running rails g devise:install again.

Let us know if you keep having problems.


#3

I still get the same error. It looks like it’s actually doing something when I add the gem to my Gemfile and run the bundle install command. Everything comes back green like it should. But as soon as I run the rails g devise:install command that is when I get the below information.

/usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/values/time_zone.rb:285: warning: circular argument reference - now
/usr/local/rvm/gems/ruby-2.3.0/gems/actionmailer-4.1.0/lib/action_mailer/base.rb:553:in method_missing': undefined methodsmtp_setting=’ for ActionMailer::Base:Class
Did you mean? smtp_settings=
smtp_settings
smtp_settings? (NoMethodError)
from /home/ubuntu/workspace/simplecodecasts_saas/config/environment.rb:7:in <top (required)>' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:inrequire’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in block in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:inload_dependency’
from /usr/local/rvm/gems/ruby-2.3.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in require' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:92:inpreload’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:143:in serve' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:131:inblock in run’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:in loop' from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application.rb:125:inrun’
from /usr/local/rvm/gems/ruby-2.3.0/gems/spring-1.7.2/lib/spring/application/boot.rb:19:in <top (required)>' from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire’
from /usr/local/rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in require' from -e:1:in

I don’t know what I am doing wrong.


#4

Which Rails version are you using?


#5

Rails 4.1.0. Should I be installing a different version of devise?