Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devise.secret_key was not set #170

Closed
mathonsunday opened this issue Oct 26, 2014 · 7 comments · Fixed by #193
Closed

Devise.secret_key was not set #170

mathonsunday opened this issue Oct 26, 2014 · 7 comments · Fixed by #193

Comments

@mathonsunday
Copy link
Contributor

Whenever I try to run the app (ex. with pow) I get this error:

RuntimeError: Devise.secret_key was not set. Please add the following to your Devise initializer:

config.secret_key = '-----'

Please ensure you restarted your application after installing Devise or setting the key.

I know we set the key in devise.rb, so I'm surprised to get this error. I get the same error when I change the key environment variable to the new key given in the error message and restart the app.

@backspace
Copy link
Contributor

Hmm, I’m running it with pow, too, and I don’t have that error. Do you have the .env.development file? What happens if you try to run it with rails s?

@tkwidmer
Copy link
Contributor

It is set on the production environment on heroku

@tkwidmer
Copy link
Contributor

I dont have this problem when I run it locally.

@tkwidmer
Copy link
Contributor

i'm not hitting this when i run locally after upgrading to Yosemite. Ill investigate.

@gnarf
Copy link
Contributor

gnarf commented Nov 17, 2014

So, I found that the environment sometimes wasn't being exported into sub commands... When I was facing this error I just did

. .env.development
export DEVISE_SECRET_KEY
export RAILS_SECRET_KEY

then all my stuff worked again.

However, this was only happening when I had a newer version of stuff than was locked in the Gemfile.lock - did you run into this error after a bundle update?

@kiesia
Copy link
Contributor

kiesia commented Jan 29, 2015

I have this issue as well, I have made a pull request to fix the issue.

@kiesia
Copy link
Contributor

kiesia commented Jan 29, 2015

Also just as a note, we are not all running OSX and we need to make sure the app works without pow etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants