Sending Devise inevitable to staging server - ruby-on-rails

I have the devise_invitable gem and it works great because I don't want anybody to be able to sign up for the app I developing. When I go to rails console I send the invite User.invite(..... everything works great and it sends the email but only for localhost:3000. I want to send it to my heroku staging server. Any ideas on what I may be missing? Please let me know if you need to see code, I'm just not sure what to post right now. Thank you!

Simply heroku run rails console

Related

Facebook OmniAuth throwing parameter app_id required when deployed on Heroku

So, I've been developing my app locally for sometime now and I decided today that I would like to deploy it on Heroku to start getting initial feedback for the app. I went through the guide on Heroku to help deploy my Rails 5 app to heroku.
Deployment was smooth and I was shown my login page. I clicked on Login Via FB and I was returned a white page with the following error response
The parameter app_id is required
Now, my obvious plan of action was to follow the trail, refer SO and hopefully come up with a solution for this. I tried every plausible resource on the web but I still get this error.
I've even updated my APP_ID and APP_SECRET variables on heroku. I've even updated Valid OAuth Redirect URIs section in my fb developer settings with the appropriate Heroku URL.
The funny bit is that everything works smoothly on my localhost but fails on heroku which is strange.
I strongly believe that Facebook would through appropriate errors and that app_id is in fact not being sent to fb. If this is the case, how do I solve this?
If you need code snippets to look at, do ask what might be needed to be looked at and I shall update my post accordingly.
Thank you!
the solution turned out to be a pretty simple one. In my application.yml file I had saved my Facebook vars as facebook_app_id and facebook_secret_key. But in my Heroku config vars I had included them as FACEBOOK_APP_ID and FACEBOOK_SECRET_KEY. I was under the impression keys aren't case sensitive. When I changed them to lowercase for Heroku, it worked.

Mails not sent in production side rails 4

I have a rails app with one form. After saving that form all data will be send in an email id. Form is working great in development side. But after deploying the app it doesn't work. It's giving the following error in the browser.
We're sorry, but something went wrong.
If you are the application owner check the logs for more information.
In this application I have another contact us form. That form work fine after deployment in production side.

Deployed ROR API to Heroku and broke it

I'm working on a Rails API for an iOS app. I was able to run it on my localhost and consume it from the iPhone simulator but now I want to test on the device. I successfully pushed to heroku and changed my ROOT_URL to be the one that it provided. Now when I visit the application URL (http://sleepy-lake-5504.herokuapp.com/v1/users if you really wanted to know), I get the error message:
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
instead of JSON data.
Am I doing something wrong? Do I need to do something special with heroku to hit it as an API?
Needless to say it's making me very sad.
Any help is appreciated.
You can create a tunnel to your localhost using ngrok. Ngrok will forward your localhost and give you a URL which you can use in your iPhone.
This will help you to debug your localhost without actually hosting your site so that you get a better idea of whats going wrong. Let me know if that helps.

Why emails are not sending on production server?

I'm using the grails plugin "mail=0.9". Emails are not sending on production server. It just works fine on development environment on localhost.
Error is given below;
Stacktrace follows:
javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:319)
at org.grails.mail.MailService.sendMail(MailService.groovy:63)
at org.grails.mail.MailService.sendMail(MailService.groovy:46)
at org.grails.mail.MailService$sendMail.call(Unknown Source)
at MailGrailsPlugin$_configureSendMail_closure4.doCall(MailGrailsPlugin.groovy:86)
at com.tkxel.chefvivant.api.SommelierController$_closure4.doCall(SommelierController.groovy:107)
at com.tkxel.chefvivant.api.SommelierController$_closure4.doCall(SommelierController.groovy)
at java.lang.Thread.run(Thread.java:636)
Can anyone help me? Why emails are not sending?
Thanks
Finally, after being spending the much time on this issue. I have fixed this error.
Actually the problem was just about to set the Gmail account settings. Google was sending the hidden captcha and that's obvious machine cannot recognize it. So that's why I was getting authentication error.
Solution:
I just unlocked the Gmail captcha and now it works fine.
Steps to reproduce this
1. Logout your gmail account first.
2. Visit this url https://accounts.google.com/DisplayUnlockCaptcha and then put username and password to login
3. Press "Continue" button to unlock the captcha
4. It will automatically save the settings.
Now, Check your application to hit the url like "Forgot Password" request. You will must receive email. :)
You can also read this article.
http://productforums.google.com/forum/#!topic/gmail/uBdBQAuGeTw
Thanks
javax.mail.AuthenticationFailedException means that you are useing incorrect credentials to access to account you use to send emails.

heroku mailer with google apps telling me to sign in via web browser

I setup google apps and heroku to send mail. I sent the first mail from within my app and everything is great. Then, I changed the email on my google apps account (from matt#website.com to team#website.com)...made sure to change it in heroku config settings...restarted...but now it gives me this error:
Net::SMTPAuthenticationError (535-5.7.1 Please log in with your web browser and then try again. Learn more at
I tried logging in via the web browser and everything is fine. I just keep getting this same error when I try to send mail now.
This should help: http://www.rocketideas.com/2012/05/gmail-error-password-not-accepted-from-server-solved/
I've tested it and it works for me.

Resources