Open lgs opened 9 years ago
That's odd. Thanks for providing the diagnostic detail. It looks like it should be fine. Try hardcoding the keys into the config/secrets.yml file (temporarily, don't check in to Git).
I've just attempted generating the app Using Rails Composer and running rake db:reset
and it works here with my ENV settings. So I suspect you have a local configuration issue.
@DanielKehoe you were right, hardcoding Stripe keys into the config/secrets.yml make it working, then I guess is something "local env" related, may be something to do with my ssl localhost configuration and the fact that I go with https://localhost:3000/ ? ... need more investigation.
I also had to hardcode keys in to secrets.yml. It looks like ENV isn't working for a lot of people.
@lgs @archonic @DanielKehoe @tmock12 The single finest answer to these questions rests here Rails Environmental Variables authored by Taylor Mock and Daniel Kehoe, last updated 20121215. Also, I will share what I have done so far to make environmental variables easy peasy. My opinion is after working all methods described in the articles is : the config/local_env.yml is the tool of choice especially if you are dealing with lots of apps, lots of repositories. It takes a minute maybe two to set up the local_env.yml file, making certain you .gitignore it because this local_env.yml file holds the crown jewels of all passwords, secret keys, etc., and make the addition of a code block in your config/application.rb file, and bham! problem solved forever on that app. And, these tests on the two tests making sure the Stripe keys are in place will pass every time. Next app, set it up the way you need and want with its own local_env.yml file in each app complete unto itself. Please note, the reference article gives a thumbs up to Figaro gem. I abandoned that gem quite a while ago, due to exact changes I cannot recall where Figaro was unuseful in terms of setting env variables on Heroku. I set the Heroku variables directly with $ heroku config add commands, one time, it is done, so no need for Figaro. I would be happy indeed to write these codes into the rails-stripe-membership-saas app, so that everyone can enjoy trouble free environment variables in development and test.
@lgs @archonic @DanielKehoe @tmock12 The two tests I mentioned are located here : https://github.com/kathyonu/rails-stripe-membership-saas/blob/testsformaster/spec/stripe/stripe_config_spec.rb
Please do note this is the testsformaster branch of my fork of the app. This branch contains a boatload of /spec tests you may find useful. They are all part of the open pull request on this branch. More tests are coming because my personal goal is 100% tests coverage of our production app, and i have found it is pretty easy to adapt those tests to the rails-stripe-membership-saas app and contribute them to RailsApps.
@kathyonu very useful, many thanks! @DanielKehoe +1 to commit that pull request #150 (even if I'd preferred pure minitest)
@lgs many welcomes @DanielKehoe i do believe this is my first +1, and have no clue what the full import of that is, butt-ha, i sure Love the idea of bringing these tests-works to fruition in the master so folks can learn to test their way out of problems and into new capabilities.
After building with
I get the following error:
even if Linux env and rails config/secrets.yml seem fine: