-
Notifications
You must be signed in to change notification settings - Fork 232
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
I get "KeyError: key not found" . #143
Comments
You need to set the MAILCHIMP_API_KEY and STRIPE_API_KEY values in either your Unix ENV variables or the config/secrets.yml file. |
Hey Daniel, Thanks for the quick reply but unfortunately that did not fix it :( .. |
Open terminal and at the command line $> source ~/.bash_profile or ~/.profile. at the command prompt and type `echo $MAILCHIMP_API_KEY - or any of the keys in question. if you see the key you specified. restart rails. |
I can see the key but the error still exists .
|
I'm getting the same error cant find the issue myself .. this is after doing a search and commenting out all blocks of code where I see Rails.application.secrets.whatever_key , in the initializers - in the user model in the secrets.yml. Just to get the first initial migration going. $> rake aborted! KeyError: key not found: "MAILCHIMP_API_KEY" |
In your config/secrets.yml file, replace the following:
with:
If you are having trouble with Unix ENV variables you don't have to use them. Just put the values into your config/secrets.yml file. But don't check it into git, just diagnose the problem by hardcoding the values. |
@rsgrafx Did you manage to fix this issue? |
I've reopened the issue as requested. Is there anyone who has not been able to resolve the issue by setting the Unix ENV variables or hardcoding the vales in the config/secrets.yml file? |
I haven't been able, either. I changed quite a few things and made it to work. Will commit to the fork and than try to diff to find out what is it that made it work. ==EDIT: just pushed my changes to my fork - you can have a look at the differences - it should be in the config directory. I've excluded the files containing sensitive data (the *yml ones) - I can give you a censored version of them, too - if necessary. |
The only purpose of the See 3fce464 |
@DanielKehoe More info : I get this error while running the composer command The errors don't go away even after adding the API keys in the environment variables. |
@ashwinputhige Could you clarify please, do you get the I get "KeyError: key not found" when the Rails Composer script is running (causing a failure before an app is created)? Or do you build an app using Rails Composer successfully, and then get the error when you launch the app with |
I get it when the rails composer script is running before the app is created. It happens at the command |
Thank you @ashwinputhige, that is helpful. |
I've released a new version of Rails Composer that removes the |
@ashwinputhige : This note replaced with my next comment. |
@ashwinputhige @nikolay12 @rsgrafx : Please see PR Testsformaster #150 . I invite you to pull this branch into your working app, and take it for a spin. You will see it has tests that resolve Issue #143 . If you can help resolve the four pending tests, that would be grand, thank you. |
@kathyonu Sorry, I am not using this application and so I will not be able to run your tests. Please feel free to close the issue if required. |
I just git cloned the repository - the problem still persists. I cancelled my Railsapp subscription - sorry Daniel, it just does not make sense to continue paying for something that is so brittle. |
@nikolay12 @ashwinputhige @rsgrafx @DanielKehoe Greetings .. I have changed my mind, ashwinputhige, and nikolay12 I ask you to change yours too .. If you will look at Issue #152, specifically the posts i made there yesterday ..you will find a resource that really is priceless in these matters of setting the enviroment variables. So that you know, I have an in production rails-stripe-membership-saas running sweet as can be, and I have gone through the exact same issues you are facing and I can easily help resolve them for you .. and others you may run into. Please re-signup with RailsApps if need be and accept this offer of help and you will have a high power fully-tested app at your fingertips .. the tests are arriving as referred to in Issue #152 and more to come. We are also going to be adding capabilities after what exists is fully tested. |
try this :) |
Getting same error. Any solution? |
Here too! This was working until I updated rails to 6.1 |
I am not an expert in rails, but here's the stack trace.
It occurs just after "run bundle exec rake db:migrate from "."" and happens for all future "rake" commands.
The text was updated successfully, but these errors were encountered: