Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools

Cody Mumford
Cody Mumford
11,531 Points

Troubleshooting my Heroku launch

So I am having trouble launching my Heroku Rails app giving me this. I don't have a procfile and I think that may be part of it. Here is my repository: https://github.com/cody-mum1228/toy_app

This is local.

Thanks in advance dudes!

2016-02-09T16:33:39.066766+00:00 heroku[api]: Enable Logplex by ----@wishforwater.com

2016-02-09T16:33:39.066832+00:00 heroku[api]: Release v2 created by -----@wishforwater.com

2016-02-09T16:34:59.699053+00:00 heroku[api]: Set LANG, RACK_ENV, RAILS_ENV, RAILS_SERVE_STATIC_FILES, SECRET_KEY_BASE config vars by -----@wishforwater.com

2016-02-09T16:34:59.699094+00:00 heroku[api]: Release v3 created by -----@wishforwater.com

2016-02-09T16:35:00.345305+00:00 heroku[api]: Release v4 created by ------@wishforwater.com

2016-02-09T16:35:00.345269+00:00 heroku[api]: Attach DATABASE resource by -------@wishforwater.com

2016-02-09T16:35:00.683471+00:00 heroku[api]: Scale to web=1 by ------@wishforwater.com

2016-02-09T16:35:00.772544+00:00 heroku[api]: Deploy c948f3b by ------@wishforwater.com

2016-02-09T16:35:00.772544+00:00 heroku[api]: Release v5 created by -------@wishforwater.com

2016-02-09T16:35:01.121740+00:00 heroku[slug-compiler]: Slug compilation started

2016-02-09T16:35:01.121746+00:00 heroku[slug-compiler]: Slug compilation finished

2016-02-09T16:35:03.165112+00:00 heroku[web.1]: Starting process with command bin/rails server -p 42068 -e production

2016-02-09T16:35:05.155917+00:00 app[web.1]: /usr/bin/env: ruby2.3: No such file or directory

2016-02-09T16:35:05.977650+00:00 heroku[web.1]: Process exited with status 127

2016-02-09T16:35:06.009940+00:00 heroku[web.1]: State changed from crashed to starting

2016-02-09T16:35:06.009088+00:00 heroku[web.1]: State changed from starting to crashed

2016-02-09T16:35:08.456475+00:00 heroku[web.1]: Starting process with command bin/rails server -p 55480 -e production

2016-02-09T16:35:10.548508+00:00 app[web.1]: /usr/bin/env: ruby2.3: No such file or directory

2016-02-09T16:35:11.429070+00:00 heroku[web.1]: Process exited with status 127

2016-02-09T16:35:13.289143+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sampleapptutu.herokuapp.com request_id=1305e85c-27b2-457b-8a98-0d27f6bf28d5 fwd="8.40.162.240" dyno= connect= service= status=503 bytes=

2016-02-09T16:35:13.866475+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sampleapptutu.herokuapp.com request_id=7088d110-dad3-48e5-bd56-78d76ea52ab2 fwd="8.40.162.240" dyno= connect= service= status=503 bytes=

2016-02-09T16:35:11.444075+00:00 heroku[web.1]: State changed from starting to crashed

2 Answers

Seth Kroger
Seth Kroger
56,414 Points

You're going through Hartl's Rails tutorial, yes? Did you deploy the "Hello World!" app ok, or did it give you the same issues?

You don't necessarily need a Procfile for Rails deployment. Heroku will use the default Rails server if it's missing. From the logs it looked like it failed to find ruby2.3 (the brand new version), which you specified in the Gemfile. Heroku defaults to 2.2, iirc, I'd suggest removing the ruby line from the Gemfile (Or, better yet use the Gemfile Hartl provides if you're using his tutorial), re running bundle install/update, and trying it again.

Cody Mumford
Cody Mumford
11,531 Points

I went through hell to change my Ruby to version 2.2, but it fixed it. Thanks for the bit advice dude.

Hi Cody,

I only know a very small amount about Ruby or Rails. However, I've deployed to Heroku before with node. It's almost seemless, except for the enviornment variables, so I checked out the quickstart for Rails, and found that procfile you were talking about in the quickstart repo. It only had one line:

web: bundle exec puma -C config/puma.rb

So I went to the config/puma.rb file it was pointing to and found this:

workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RACK_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
end

There are those enviornment variables I was talking about. So I don't know how you want to implement it or how, because I'm not a Ruby on Rails guy, but you have to point the server to those PORT, RACK_ENV, etc. variables. I hope that helps. Happy coding!

Nicolas