Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialsabanosrati
1,451 PointsErrors after installing Devise
After I installed Devise, then tried to start the rails server, I get the following error. The top part refers to a secret_key which I see exists in config/initializers/devise.rb
I'm on Rails 4.0.2 and don't want to downgrade for the sake of this project.
Any help would be very much appreciated.
Exiting
/Users/someone1/Desktop/ruby tests/treebook/config/initializers/devise.rb:7:in `block in <top (required)>': undefined method `secret_key=' for Devise:Module (NoMethodError)
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.0.0.rc/lib/devise.rb:265:in `setup'
from /Users/someone1/Desktop/ruby tests/treebook/config/initializers/devise.rb:3:in `<top (required)>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `block in load'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:223:in `load'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine.rb:609:in `block (2 levels) in <class:Engine>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine.rb:608:in `each'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/engine.rb:608:in `block in <class:Engine>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:30:in `run'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `each'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/someone1/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/application.rb:215:in `initialize!'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/someone1/Desktop/ruby tests/treebook/config/environment.rb:5:in `<top (required)>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `block in require'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.2/lib/active_support/dependencies.rb:229:in `require'
from /Users/someone1/Desktop/ruby tests/treebook/config.ru:3:in `block in <main>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/someone1/Desktop/ruby tests/treebook/config.ru:in `new'
from /Users/someone1/Desktop/ruby tests/treebook/config.ru:in `<main>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/commands/server.rb:48:in `app'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/commands/server.rb:75:in `start'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/commands.rb:71:in `tap'
from /Users/someone1/.rvm/gems/ruby-2.0.0-p353/gems/railties-4.0.2/lib/rails/commands.rb:71:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
My git repository: https://github.com/sabanosrati/treebook.git
3 Answers
Glenn Harris
7,101 PointsOkay, so I cloned your repo and fooled around with it on my system. Here is what I did to make it work, it may or may not work for you.
From command line:
1)gem uninstall devise 2)gem install devise 3)bundle update 4)rails s
It worked.
Glenn Harris
7,101 PointsDid you update your repository on Github after you installed devise? I checked your Gemfile and didn't see devise listed.
sabanosrati
1,451 PointsSorry, I updated it.
sabanosrati
1,451 PointsSorry, just updated it now.
sabanosrati
1,451 Pointssabanosrati
1,451 PointsThank you!