简体   繁体   中英

Error H10 when deploying Sinatra app to Heroku

I cannot get my app to deploy to Heroku. So frustrating.

Here is the repository: repository link

Things I have tried:

  • I have updated my config.ru with everything I need per the heroku deployment page found here
  • I have run heroku run rake db:migrate
  • I have run heroku restart
  • I have ensured I have an updated gemfile
  • I double checked that I have the 'require' statements in my app.rb

Any thoughts? My error logs I am getting are below:

2014-11-02T03:46:07.404128+00:00 heroku[api]: Deploy bbe19c1 by johnsalzarulo@gmail.com
2014-11-02T03:46:07.404202+00:00 heroku[api]: Release v17 created by johnsalzarulo@gmail.com
2014-11-02T03:46:08.439283+00:00 heroku[web.1]: State changed from crashed to starting
2014-11-02T03:46:11.353727+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 43798`
2014-11-02T03:46:13.210413+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
2014-11-02T03:46:13.210411+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
2014-11-02T03:46:13.210388+00:00 app[web.1]: /app/config.ru:1:in `require': cannot load such file -- ./gifinder (LoadError)
2014-11-02T03:46:13.210410+00:00 app[web.1]:    from /app/config.ru:1:in `block in <main>'
2014-11-02T03:46:13.210424+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
2014-11-02T03:46:13.210425+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
2014-11-02T03:46:13.210414+00:00 app[web.1]:    from /app/config.ru:in `new'
2014-11-02T03:46:13.210415+00:00 app[web.1]:    from /app/config.ru:in `<main>'
2014-11-02T03:46:13.210417+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
2014-11-02T03:46:13.210419+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
2014-11-02T03:46:13.210418+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
2014-11-02T03:46:13.210421+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
2014-11-02T03:46:13.210427+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
2014-11-02T03:46:13.210430+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
2014-11-02T03:46:13.210432+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
2014-11-02T03:46:13.210434+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/bin/rackup:23:in `load'
2014-11-02T03:46:13.210437+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.1.0/bin/rackup:23:in `<main>'
2014-11-02T03:46:13.977897+00:00 heroku[web.1]: State changed from starting to crashed
2014-11-02T03:46:13.970947+00:00 heroku[web.1]: Process exited with status 1
2014-11-02T03:46:15.252296+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gifinder.herokuapp.com request_id=7106f663-fa15-4c74-ab8e-f5df75030a55 fwd="174.129.111.111" dyno= connect= service= status=503 bytes=
2014-11-02T03:46:42.265175+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=gifinder.herokuapp.com request_id=900cbb04-7ee9-4392-9f2f-7d4e833b15c0 fwd="24.43.108.83" dyno= connect= service= status=503 bytes=
2014-11-02T03:46:43.407062+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=gifinder.herokuapp.com request_id=ce46eed0-4a7f-4633-81ec-c826a3c90e30 fwd="24.43.108.83" dyno= connect= service= status=503 bytes=

Your config.ru file is trying to load a non-existent file with the require statement. Change this line require './gifinder' to:

require './app'

or, change the filename of app.rb to gifinder.rb . You should also follow iain's advice and remove the double Gemfile.lock because that's bound to cause problems.

Your require for HTTParty should also be lowercase. I fetched your repo and got it work on heroku by changing the require to all lowercase:

require 'httparty'

I don't know how you've done it, but you have two Gemfile.lock s. I'd remove them both and re-run Bundler, and git rm the one that shouldn't be there.

Also note that Heroku now uses procfiles more extensively than previously, so get hold of Foreman and define a procfile .


In addition, when I run bundle install --binstubs --path=vendor I get this message:

Post-install message from heroku: ! The heroku gem has been deprecated and replaced with the Heroku Toolbelt. ! Download and install from: https://toolbelt.heroku.com ! For API access, see: https://github.com/heroku/heroku.rb

so remove gem 'heroku', '~> 3.15.0' from the Gemfile and require 'heroku' (which was never needed in the app anyway) from app.rb. When I do that, the command bin/rackup config.ru runs the app for me on localhost:9292 just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM