Hartl's Rails Tutorial Completed Works Locally Perfect. Heroku Persists "We'Re Sorry, But Something Went Wrong."

Hartl's rails tutorial completed works locally perfect. Heroku persists We're sorry, but something went wrong.

Sounds to me like you didn't load the schema into your heroku database. After deploying what happens when you do this:

heroku run rake db:schema:load

Note that sometimes if you're loading up a new app that has an already-established schema, running all the migrations isn't the best way to get the database to the state you want - you should use rake db:schema:load instead. Let me know if this gets your database correct.

After running it you can use heroku run console and then do console commands like User.all to make sure it knows that the users table exists etc.

Don't forget to restart your server after loading the schema, or running db:migrate. For heroku that'd be: heroku restart

heroku - Missing required arguments: aws_access_key_id, aws_secret_access_key, following Hartl tutorial

Go on Heroku, on your application, go to settings, hit Reveal Config Vars.

Click on on Edit on the right side and enter your secrets there:

S3_BUCKET: name of your bucket goes here
S3_ACCESS_KEY: xxxxx
S3_SECRET_KEY: xxxx

On config/initializers/carrierwave.rb or wherever you're entering your secrets should have:

CarrierWave.configure do |config|
config.root = Rails.root.join('tmp') # adding these...
config.cache_dir = 'carrierwave' # ...two lines

config.fog_credentials = {
:provider => 'AWS', # required
:s3_access_key_id => ENV['S3_ACCESS_KEY'], # required
:s3_secret_access_key => ENV['S3_SECRET_KEY'], # required
:region => 'eu-west-1', # optional, defaults to 'us-east-1'
:host => 's3.example.com', # optional, defaults to nil
:endpoint => 'https://s3.example.com:8080' # optional, defaults to nil
}
config.fog_directory = ENV['S3_Bucket'] # required
config.fog_public = false # optional, defaults to true
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end

railstutorial.org signup mechanism fails on the deployed app via Heroku

SMTP server setup on Heroku

I completed the tutorial a while ago. Still have my code. Maybe I can help.

From the error:

Net::SMTPFatalError (550 Unauthenticated senders not allowed
2015-08-29T12:37:31.860570+00:00 app[web.1]: ):

Production.rb

It seems your SMTP server is not set up. If you're following the tutorial Sendgrid is your mail server. Here's the SMTP setup from production.rb from the tutorial. Is this what you have?

  # Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp

host = 'your-heroku-app-9999.herokuapp.com'
config.action_mailer.default_url_options = { host: host }
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'heroku.com',
:enable_starttls_auto => true
}

Mail server environment variables on Heroku

These 2 environment variables need to be setup in your app's Heroku setup. Given the error you're seeing I suspect this is the problem. The username and password must also be setup on Sendgrid itself.

ENV['SENDGRID_USERNAME'],
ENV['SENDGRID_PASSWORD'],

I think you're close to having this work, you just need to complete the mail server setup. Please let me know if this helps or if you have questions.

P.S. It could be a REGEX issue, but I would make confirm the setup is solid before diving into the model debugging.

Presence validation fails on Heroku even though it works locally

You can verify that your master has been pushed by doing a git diff heroku/master. If you've committed and deployed everything properly, this should show no changes.

Ruby on Rails 3 Tutorial: 'Heroku Console'

Something is definitely wrong, and from what you've said it doesn't look like you. I would contact support.



Related Topics



Leave a reply



Submit