thoughtbot / ios-on-rails

A guide to building a Rails API and iOS app
Other
76 stars 6 forks source link

Deployment to heroku error #120

Closed shingletondotorg closed 9 years ago

shingletondotorg commented 9 years ago

Trying to deploy to heroku but I keep getting a

rake aborted! KeyError: key not found: "SMTP_ADDRESS"

which results in Push rejected, failed to compile Ruby app

How can I disable this as it is not needed for the purpose of the tutorial, but I assume was created when using suspenders to initialise the rails app re the tutorial

jessieay commented 9 years ago

Hey there - thanks for writing in!

It sounds like your are writing about two issues - one is rake failing, and the other is pushing to Heroku.

To get rake to pass, you will need to set up a file in the root directory called .sample.env with the SMTP_ADDRESS env variable in it. You will also need the other variables. That file can look like this:

# .sample.env

SMTP_ADDRESS=example.com
SMTP_DOMAIN-example.com
SMTP_PASSWORD=example_password
SMTP_USERNAME=example_username

alternatively, you can set up your test environment to not send emails, which I believe will remove that error when running your tests with rake: http://stackoverflow.com/a/10970085/1019369

As for the Heroku deploy issue, can you post the full backtrace you're seeing when trying to deploy? If you do, I can try to help debug the situation.

Also, did you clone the rails example app directly, or have you been following along with the book and creating it on your own?

shingletondotorg commented 9 years ago

Hi Jessleasy.

Thanks for getting back to me so quickly. I did not clone your app but created a new one using the suspenders create function. Follow your two suggestions but still not able to push the project to heroku

The activity log put out is at http://pastebin.com/5iWQ2YwL

shingletondotorg commented 9 years ago

Ended up just creating a new rails project not using suspenders, and I could deploy it to heroku ok.

Thanks for you assistance though