My app has a contact page where users can input their name/email/subject/content and send me a message. I'm using the Sendgrid addon to heroku and think I've done almost everything right. I've got this in my
emails_controller.rb
if #email.save
ContactMailer.contact_message(#email).deliver
flash.now[:success] = "Your email has sent! I'll try to get back to you shortly."
render :new
else
flash.now[:error] = "Please correct the highlighted errors and try again."
render :new
end
(the idea here is to keep a record of each email and also send it to me).
My config/initializers/mail.rb
# SendGrid Settings
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => '587',
:authentication => :plain,
:enable_starttls_auto => true,
:user_name => ENV['SENDGRID_USERNAME'],
:password => ENV['SENDGRID_PASSWORD'],
:domain => 'myappname.com'
}
ActionMailer::Base.delivery_method = :smtp
Then, for good measure, following what someone else did in a sendgrid support question. config/environments/production.rb:
config.action_mailer.default_url_options = { :host => 'myappname.com' }
My contact_email.html.erb:
class Contact < ActionMailer::Base
default from: "unimportant#example.com"
def contact_message(email)
#name = email.name
#address = email.address
#subject = email.subject
#content = email.content
mail(:to => ENV['EMAIL_ADDRESS'], :subject => #subject)
end
end
I added all the necessary environmental variables through
heroku config:add EMAIL_ADDRESS=blah#blah.com
heroku config:add SENDGRID_USERNAME=blah
When I push to heroku and try to send myself an email, though, it gives me the "We're sorry. Something went wrong" screen of death, and the logs are (to my eyes) totally useless.
Here's the log starting from when I last pushed to heroku and tried to send myself an email. Any ideas what's possibly going wrong?
2013-02-03T20:34:18+00:00 heroku[router]: at=info method=GET path=/ host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=7ms service=201ms status=304 bytes=0
2013-02-03T20:34:18+00:00 heroku[router]: at=info method=GET path=/assets/application-cd9c41b78562d03bb04bcaaa585b31e8.js host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=11ms status=200 bytes=125507
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/pig3-b2d5155bd2811a87cafec6a447459580.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=200 bytes=3010
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/github-e8c3b3f49b0cc737afe9b3cd6e9ab159.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=4ms status=200 bytes=3687
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/odesk2-38dadc2e6b0e94aa6c6766df301716bc.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=1ms connect=2ms service=4ms status=200 bytes=3932
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/star-02718a47b29575c2d7a0e75ac8bebf4d.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=200 bytes=3104
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/empty_star-9bf002077eafec40cf239068f7d4d1ca.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=43ms status=200 bytes=3072
2013-02-03T20:34:23+00:00 heroku[router]: at=info method=GET path=/emails/new host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=1ms service=119ms status=200 bytes=3022
2013-02-03T20:34:23+00:00 heroku[router]: at=info method=GET path=/assets/application-74fd2354261a1131b26861b47bef1d87.css host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=4ms status=304 bytes=0
2013-02-03T20:34:19+00:00 heroku[router]: at=info method=GET path=/assets/headshot-767c8913c7af4fc97cb8e15881884f0e.png host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=4ms connect=6ms service=11ms status=200 bytes=146892
2013-02-03T20:34:39+00:00 heroku[router]: at=info method=POST path=/emails host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=7ms service=131ms status=500 bytes=643
2013-02-03T20:34:39+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=<appname>-2591.herokuapp.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=1ms connect=3ms service=5ms status=200 bytes=0
Also, I DID add Sendgrid (followed Heroku's instructions), and the Sendgrid user interface shows no emails sent. And the last time I tried this, the following line seemed to be the only one in the heroku logs that was relevantly timestamped when I tried to send another message. Not very helpful:
2013-02-04T18:15:45+00:00 heroku[router]: at=info method=GET path=/contact host=myappname.com fwd=69.181.104.85 dyno=web.1 queue=0 wait=0ms connect=2ms service=334ms status=200 bytes=3695
Since it's not showing up on your SendGrid dashboard, my guess would be that your credentials are wrong in the app. If you type heroku config do you see that SENDGRID_USERNAME and SENDGRID_PASSWORD are set correctly?
Also, you might want to try setting delivery errors to display in your config file.
config.action_mailer.raise_delivery_errors = true
Just for a bit of clarification, you can't access the Account Settings on the SendGrid site because Heroku has locked it down. You adjust those same settings from the Heroku interface directly.
Related
I just started to try out copycopter but the out of the box app seems to be crashing. I pretty much just ran the instructions at https://github.com/copycopter/copycopter-server, but clearly something isn't working right. This is the last several lines of my heroku log, but I can give more detail if needed. I see that it's using old style plugins - is that related and if so what needs to be changed?
2013-07-12T03:05:16.164555+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-12T03:05:19.529261+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 35563`
2013-07-12T03:05:20.460981+00:00 app[web.1]: The source :rubygems is deprecated because HTTP requests are insecure.
2013-07-12T03:05:20.460981+00:00 app[web.1]: Please change your source to 'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
2013-07-12T03:05:21.439397+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:2)
2013-07-12T03:05:21.439132+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:2)
2013-07-12T03:05:21.841751+00:00 app[web.1]: >> Using rack adapter
2013-07-12T03:05:21.841751+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2013-07-12T03:05:23.382849+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-12T03:05:22.241366+00:00 app[web.1]: ruby: symbol lookup error: /app/vendor/bundle/ruby/2.0.0/gems/eventmachine-0.12.10/lib/rubyeventmachine.so: undefined symbol: rb_enable_interrupt
2013-07-12T03:05:22.239348+00:00 app[web.1]: >> Thin web server (v1.3.1 codename Triple Espresso)
2013-07-12T03:05:22.239348+00:00 app[web.1]: >> Maximum connections set to 1024
2013-07-12T03:05:22.239348+00:00 app[web.1]: >> Listening on 0.0.0.0:35563, CTRL+C to stop
2013-07-12T03:05:23.374312+00:00 heroku[web.1]: Process exited with status 127
2013-07-12T03:05:29.748682+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:05:30.170778+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:08:14.843800+00:00 heroku[api]: Starting process with command `bundle exec rake copycopter:project NAME=My Project Name USERNAME=admin PASSWORD=password` by foobar#xyzzy.com
2013-07-12T03:08:20.694207+00:00 heroku[run.1389]: Awaiting client
2013-07-12T03:08:20.742807+00:00 heroku[run.1389]: Starting process with command `bundle exec rake copycopter:project NAME=My Project Name USERNAME=admin PASSWORD=password`
2013-07-12T03:08:21.977568+00:00 heroku[run.1389]: State changed from starting to up
2013-07-12T03:08:27.647200+00:00 heroku[run.1389]: Process exited with status 1
2013-07-12T03:08:27.670344+00:00 heroku[run.1389]: State changed from up to complete
2013-07-12T03:08:53.981716+00:00 heroku[api]: Starting process with command `bundle exec rake copycopter:project NAME=MyProjectName USERNAME=admin PASSWORD=password` by foobar#xyzzy.com
2013-07-12T03:09:00.543650+00:00 heroku[run.5825]: Awaiting client
2013-07-12T03:09:00.597438+00:00 heroku[run.5825]: Starting process with command `bundle exec rake copycopter:project NAME=MyProjectName USERNAME=admin PASSWORD=password`
2013-07-12T03:09:01.900564+00:00 heroku[run.5825]: State changed from starting to up
2013-07-12T03:09:06.612032+00:00 heroku[run.5825]: Process exited with status 0
2013-07-12T03:09:06.625397+00:00 heroku[run.5825]: State changed from up to complete
2013-07-12T03:09:11.063317+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:09:11.277609+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:09:12.850149+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:09:13.020609+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:09:41.765591+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
2013-07-12T03:09:42.022288+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=myname.herokuapp.com fwd="XX.XXX.XXX.XX" dyno= connect= service= status=503 bytes=
I had the same issue. I changed the gemfile of copycopter-server locally:
rails 3.2.6 to rails 3.2.13
"source :rubygems" must be "source "https://rubygems.org"
and most importantly your eventmachine version in gemfile.lock must be updated to :
"eventmachine (1.0.3)"
And then run bundle update rails, bundle install and push to heroku again, and heroku run rake db:migrate again.
Hope this works for you too!
references: https://github.com/copycopter/copycopter-server/issues/86
I'm following Michael Hartls tutorial for Ruby on Rails Web Development and reached the end of Chapter 7 regarding sign ups (http://ruby.railstutorial.org/chapters/sign-up#sec-tests_for_user_signup).
Launching the application on my localhost works fine and launching it onto Heroku worked up to this chapter, however now I get H10 errors.
I have reviewed the heroku logs and I don't appear to have any syntax or un-installed gemfiles. I also ran heroku run rake db:migrate before opening the site on heroku. However I still get the same error.
If you can, any help would be very much appreciated.
Thank you for your time.
2013-06-29T09:04:54.821851+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-06-29T09:04:55.047372+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2013-06-29T09:04:55.047983+00:00 app[web.1]: from script/rails:6:in `<main>'
2013-06-29T09:04:55.046955+00:00 app[web.1]: See everything in the log (default is :info)
2013-06-29T09:04:55.046955+00:00 app[web.1]: ^
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
2013-06-29T09:04:55.046955+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': /app/config/environments/production.rb:33: syntax error, unexpected keyword_in, expecting keyword_end (SyntaxError)
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:571:in `block in <class:Engine>'
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/config.ru:3:in `require'
2013-06-29T09:04:55.046955+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/config.ru:in `new'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2013-06-29T09:04:55.068195+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2013-06-29T09:04:55.068195+00:00 app[web.1]: => Call with -d to detach
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2013-06-29T09:04:55.047983+00:00 app[web.1]: from script/rails:6:in `require'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2013-06-29T09:04:55.047212+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2013-06-29T09:04:55.047831+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2013-06-29T09:04:55.068195+00:00 app[web.1]: => Booting WEBrick
2013-06-29T09:04:55.068195+00:00 app[web.1]: Exiting
2013-06-29T09:04:55.068195+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:37944
2013-06-29T09:04:56.568729+00:00 heroku[web.1]: Process exited with status 1
2013-06-29T09:04:56.582829+00:00 heroku[web.1]: State changed from starting to crashed
2013-06-29T09:04:43+00:00 heroku[slug-compiler]: Slug compilation finished
2013-06-29T09:04:57.782340+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:04:57.994965+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:10:58.047688+00:00 heroku[web.1]: State changed from crashed to starting
2013-06-29T09:11:06.335632+00:00 heroku[web.1]: Starting process with command `bundle exec rails server -p 24215`
2013-06-29T09:11:17.398786+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-29T09:11:17.398207+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-29T09:11:17.398518+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
2013-06-29T09:11:19.607748+00:00 heroku[web.1]: State changed from starting to crashed
2013-06-29T09:11:18.240845+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
2013-06-29T09:11:18.240707+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': /app/config/environments/production.rb:33: syntax error, unexpected keyword_in, expecting keyword_end (SyntaxError)
2013-06-29T09:11:18.240707+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/config.ru:3:in `require'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/config.ru:3:in `block in <main>'
2013-06-29T09:11:18.240845+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/config.ru:in `new'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
2013-06-29T09:11:18.252865+00:00 app[web.1]: => Booting WEBrick
2013-06-29T09:11:18.241446+00:00 app[web.1]: from script/rails:6:in `<main>'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from script/rails:6:in `require'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
2013-06-29T09:11:18.252865+00:00 app[web.1]: => Rails 3.2.13 application starting in production on http://0.0.0.0:24215
201
3-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
2013-06-29T09:11:18.240707+00:00 app[web.1]: See everything in the log (default is :info)
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
2013-06-29T09:11:18.240845+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:571:in `block in <class:Engine>'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
2013-06-29T09:11:18.252865+00:00 app[web.1]: => Ctrl-C to shutdown server
2013-06-29T09:11:18.252865+00:00 app[web.1]: Exiting
2013-06-29T09:11:18.240707+00:00 app[web.1]: ^
2013-06-29T09:11:18.241002+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
2013-06-29T09:11:18.241143+00:00 app[web.1]: from /app/config.ru:in `<main>'
2013-06-29T09:11:18.241446+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
2013-06-29T09:11:18.252865+00:00 app[web.1]: => Call with -d to detach
2013-06-29T09:11:19.595243+00:00 heroku[web.1]: Process exited with status 1
2013-06-29T09:11:48.220707+00:00 heroku[api]: Starting process with command `bundle exec rake db:migrate` by markmurray406#gmail.com
2013-06-29T09:11:52.813935+00:00 heroku[run.9768]: Awaiting client
2013-06-29T09:11:52.839976+00:00 heroku[run.9768]: Starting process with command `bundle exec rake db:migrate`
2013-06-29T09:11:54.059389+00:00 heroku[run.9768]: State changed from starting to up
2013-06-29T09:11:58.081983+00:00 heroku[run.9768]: Process exited with status 1
2013-06-29T09:11:58.103006+00:00 heroku[run.9768]: State changed from up to complete
2013-06-29T09:12:38.785250+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:12:41.235151+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:12:41.413239+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:12:38.922579+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:12:50.528089+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
2013-06-29T09:12:50.689987+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=pacific-dawn-2489.herokuapp.com fwd="109.78.252.61" dyno= connect= service= status=503 bytes=
Reading your logs (t's an art to read 'em - you'll improve), it seems from the above that you have this error:
/app/config/environments/production.rb:33: syntax error, unexpected keyword_in, expecting keyword_end (SyntaxError)
Check out your app/config/environments/production.rb - I bet you'll find your mistake there.
And it probably never surfaced locally because you didn't run in production mode.
I have a user model based off of Michael Hartl's Ruby on Rails Tutorial (Second Edition) It works fine in practice locally hosted from a linux box but when I deploy to Heroku there is a problem with IE ans Safari. (Chrome and firefox work great.) I use the cookie to set the value current_user which I call constantly on the site.
here is my sessions_helper.rb
module SessionsHelper
def sign_in(user)
cookies.permanent[:remember_token] = user.remember_token
self.current_user = user
end
def signed_in?
!current_user.nil?
end
def current_user=(user)
#current_user = user
end
def current_user
#current_user ||= User.find_by_remember_token(cookies[:remember_token])
end
def current_user?(user)
user == current_user
end
def signed_in_user
unless signed_in?
store_location
redirect_to signin_url, notice: "Please sign in."
end
end
def sign_out
self.current_user = nil
cookies.delete(:remember_token)
end
def redirect_back_or(default)
redirect_to(session[:return_to] || default)
session.delete(:return_to)
end
def store_location
session[:return_to] = request.url
end
end
My sessions controller is as follows:
class SessionsController < ApplicationController
def new
end
def create
user = User.find_by_email(params[:session][:email].downcase)
if user && user.authenticate(params[:session][:password])
sign_in user
redirect_back_or user
else
flash.now[:error] = 'Invalid email/password combination'
render 'new'
end
end
def destroy
sign_out
redirect_to root_url
end
end
Again when I create a user/log in it looses my cookie only in IE8> and Safari.
Here is the log I'm getting.
2012-11-06T19:28:08+00:00 app[web.1]: Started POST "/sessions" for XXX.XXX.XXX.XXX at 2012-11-06 19:28:08 +0000
2012-11-06T19:28:08+00:00 app[web.1]: Processing by SessionsController#create as HTML
2012-11-06T19:28:08+00:00 app[web.1]: Parameters: {"utf8"=>"รข", "authenticity_token"=>"Eh3xta4VHlHgBVEKiLn3CRKgWb5xFbAx91eNJlYFySs=", "session"=>{"email"=>"A#User.com", "password"=>"[FILTERED]"}, "commit"=>"Sign in"}
2012-11-06T19:28:08+00:00 app[web.1]: WARNING: Can't verify CSRF token authenticity
2012-11-06T19:28:08+00:00 app[web.1]: Redirected to https://some-app_1234.herokuapp.com/users/1
2012-11-06T19:28:08+00:00 app[web.1]: Completed 302 Found in 391ms (ActiveRecord: 16.1ms)
2012-11-06T19:28:08+00:00 heroku[router]: POST some-app-1234.herokuapp.com/sessions dyno=web.1 queue=0 wait=0ms service=508ms status=302 bytes=114
2012-11-06T19:28:09+00:00 app[web.1]:
2012-11-06T19:28:09+00:00 app[web.1]:
2012-11-06T19:28:09+00:00 app[web.1]: Started GET "/users/1" for XXX.XXX.XXX.XXX at 2012-11-06 19:28:09 +0000
2012-11-06T19:28:09+00:00 app[web.1]: Processing by UsersController#show as HTML
2012-11-06T19:28:09+00:00 app[web.1]: Parameters: {"id"=>"1"}
2012-11-06T19:28:09+00:00 app[web.1]: Rendered shared/_stats.html.erb (205.2ms)
2012-11-06T19:28:09+00:00 app[web.1]: Rendered microposts/_micropost.html.erb (15.0ms)
2012-11-06T19:28:09+00:00 app[web.1]: Rendered users/show.html.erb within layouts/application (247.6ms)
2012-11-06T19:28:09+00:00 app[web.1]: Rendered layouts/_shim.html.erb (0.0ms)
2012-11-06T19:28:09+00:00 app[web.1]: Rendered layouts/_header.html.erb (1.2ms)
2012-11-06T19:28:09+00:00 app[web.1]: Rendered layouts/_footer.html.erb (0.3ms)
2012-11-06T19:28:09+00:00 app[web.1]: Completed 200 OK in 256ms (Views: 52.5ms | ActiveRecord: 202.4ms)
2012-11-06T19:28:09+00:00 heroku[router]: GET some-app-1234.herokuapp.com/users/1 dyno=web.1 queue=0 wait=0ms service=544ms status=200 bytes=2394
The problem was I was dns forwarding using an iframe! This made the cookie a third party cookie. If I forward to the actual heroku address it solves the problem. Hope my stupidity helps someone else.
Alright so I have 2 models with uploads, an Auction and a User.
I'm using Paperclip, Rails 3.2, and Ruby 1.9.3. The platform is Heroku Cedar.
Here's the credential details:
S3_BUCKET = ENV['S3_BUCKET'] || "..."
S3_ID = ENV['S3_ID'] || "AKIAJXD4ZBGYF24..."
S3_KEY = ENV['S3_KEY'] || "fJ7eNKQtFGf1s..."
S3_UPLOAD_OPTIONS = {
storage: :s3,
bucket: S3_BUCKET,
s3_credentials: {
access_key_id: S3_ID,
secret_access_key: S3_KEY
}
}
Auction file uploads are working fine. Everything is as expected.
User uploads do not work, and have zero errors as shown below:
2012-05-17T20:39:16+00:00 app[web.1]:
2012-05-17T20:39:16+00:00 app[web.1]: DalliError: No server available
2012-05-17T20:39:16+00:00 app[web.1]:
2012-05-17T20:39:16+00:00 app[web.1]:
2012-05-17T20:39:16+00:00 app[web.1]: Started PUT "/users" for 208.117.193.99 at 2012-05-17 20:39:16 +0000
2012-05-17T20:39:18+00:00 heroku[router]: POST cfac-staging.herokuapp.com/users dyno=web.1 queue=0 wait=0ms service=2006ms status=302 bytes=113
2012-05-17T20:39:18+00:00 app[web.1]: cache: [POST /users] invalidate, pass
2012-05-17T20:39:18+00:00 app[web.1]:
2012-05-17T20:39:18+00:00 app[web.1]: DalliError: No server available
2012-05-17T20:39:18+00:00 app[web.1]:
2012-05-17T20:39:18+00:00 app[web.1]:
2012-05-17T20:39:18+00:00 app[web.1]: Started GET "/auctions/new" for 208.117.193.99 at 2012-05-17 20:39:18 +0000
2012-05-17T20:39:19+00:00 heroku[router]: GET cfac-staging.herokuapp.com/auctions/new dyno=web.1 queue=0 wait=0ms service=1154ms status=304 bytes=0
2012-05-17T20:39:19+00:00 app[web.1]: cache: [GET /auctions/new] miss
2012-05-17T20:39:19+00:00 app[web.1]: DalliError: No server available
2012-05-17T20:39:19+00:00 app[web.1]: cache: [GET /assets/blank-avatar-9a23306b75ac790741fc7e05300183b6.png] miss
2012-05-17T20:39:19+00:00 heroku[router]: GET cfac-staging.herokuapp.com/assets/blank-avatar-9a23306b75ac790741fc7e05300183b6.png dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=2212
2012-05-17T20:39:19+00:00 app[web.1]: DalliError: No server available
2012-05-17T20:39:19+00:00 app[web.1]: cache: [GET /assets/get-started-button-f7e9baac88feb2effa461b697df8bcd9.png] miss
2012-05-17T20:39:19+00:00 heroku[router]: GET cfac-staging.herokuapp.com/assets/get-started-button-f7e9baac88feb2effa461b697df8bcd9.png dyno=web.1 queue=0 wait=0ms service=3ms status=200 bytes=2451
I have no idea why the DalliError bit is happening either, so...
Here are the User and Auction models:
class User < ActiveRecord::Base
has_attached_file :logo, { styles: { medium: "x125", thumb: "x40" } }.merge!(S3_UPLOAD_OPTIONS)
end
class Auction < ActiveRecord::Base
has_attached_file :image, { styles: { medium: "122x122#", thumb: "80x80#" }, default_url: ActionController::Base.helpers.image_path('blank-avatar.png') }.merge!(S3_UPLOAD_OPTIONS)
end
I have problem in my heroku app, I am trying to send email using my Godaddy email account, here is my settings in the environment/production.rb:
config.active_support.deprecation = :notify
config.action_mailer.default_url_options = { :host => 'coursebuilder2.heroku.com' }
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtpout.secureserver.net",
:port => 25,
:user_name => "myemail#domain.com",
:password => "password",
:authentication => :login
}
config.action_mailer.raise_delivery_errors = true
but, here is what I get:
Rendered instructors/mailer/confirmation_instructions.html.erb (1.1ms)
Completed 500 Internal Server Error in 666ms
SocketError (getaddrinfo: Name or service not known):
cache: [POST /instructors] invalidate, pass
So, what's I am missing here ?
EDIT
I have fixed the settings above, but, now, I have a timeout error below:
2012-03-04T04:44:20+00:00 app[web.1]: Rendered instructors/mailer/confirmation_instructions.html.erb (0.4ms)
2012-03-04T04:44:50+00:00 heroku[router]: Error H12 (Request timeout) -> POST coursebuilder2.herokuapp.com/instructors dyno=web.1 queue= wait= service=30000ms status=503 bytes=0
2012-03-04T04:45:20+00:00 app[web.1]: Completed 500 Internal Server Error in 60414ms
2012-03-04T04:45:20+00:00 app[web.1]:
2012-03-04T04:45:20+00:00 app[web.1]:
2012-03-04T04:45:20+00:00 app[web.1]: Timeout::Error (Timeout::Error):
2012-03-04T04:45:20+00:00 app[web.1]:
2012-03-04T04:45:20+00:00 app[web.1]:
2012-03-04T04:45:20+00:00 app[web.1]: cache: [POST /instructors] invalidate, pass
Any one can advice ?
That looks like you're using the wrong connection details to GoDaddy - to be honest, I'd be inclined to use the SendGrid free addon which is widely used and documented.