0

I'm trying to launch my rails app from my local computer to HEROKU. I've searched on stackoverflow but I can't seem to find information about this issue - Some say it's a profile and others say it's a package.json file. None of it actually worked - is there something I'm missing?

Gem File

group :development do 
# Use sqlite3 as the database for Active Record
  gem 'sqlite3'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end

Heroku Logs --Tail

2019-05-14T07:31:46.981736+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-14T07:31:50.681385+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 18879 -e production`
2019-05-14T07:31:55.137458+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-14T07:31:55.106359+00:00 heroku[web.1]: Process exited with status 1
2019-05-14T07:31:55.019384+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:33:in `require': cannot load such file -- thin (LoadError)
2019-05-14T07:31:55.019424+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-05-14T07:31:55.019426+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-05-14T07:31:55.019428+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-05-14T07:31:55.019438+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler/thin.rb:1:in `<top (required)>'
2019-05-14T07:31:55.019440+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
2019-05-14T07:31:55.019446+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
2019-05-14T07:31:55.019448+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2019-05-14T07:31:55.019450+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
2019-05-14T07:31:55.019451+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2019-05-14T07:31:55.019453+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-05-14T07:31:55.019458+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-05-14T07:31:55.019460+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-05-14T07:31:55.019467+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler.rb:20:in `const_get'
2019-05-14T07:31:55.019469+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler.rb:20:in `block in get'
2019-05-14T07:31:55.019470+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler.rb:20:in `each'
2019-05-14T07:31:55.019472+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler.rb:20:in `inject'
2019-05-14T07:31:55.019473+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/handler.rb:20:in `get'
2019-05-14T07:31:55.019475+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/rack-2.0.7/lib/rack/server.rb:301:in `server'
2019-05-14T07:31:55.019477+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:105:in `use_puma?'
2019-05-14T07:31:55.019482+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:76:in `print_boot_information'
2019-05-14T07:31:55.019484+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:47:in `start'
2019-05-14T07:31:55.019486+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:147:in `block in perform'
2019-05-14T07:31:55.019487+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `tap'
2019-05-14T07:31:55.019489+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands/server/server_command.rb:142:in `perform'
2019-05-14T07:31:55.019490+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
2019-05-14T07:31:55.019492+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
2019-05-14T07:31:55.019494+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
2019-05-14T07:31:55.019495+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
2019-05-14T07:31:55.019500+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
2019-05-14T07:31:55.019502+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
2019-05-14T07:31:55.019504+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
2019-05-14T07:31:55.019505+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
2019-05-14T07:31:55.019507+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
2019-05-14T07:31:55.019508+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
2019-05-14T07:31:55.019510+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
2019-05-14T07:31:55.019512+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
2019-05-14T07:31:55.019513+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
2019-05-14T07:31:55.019515+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.5.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
2019-05-14T07:31:55.019522+00:00 app[web.1]: from bin/rails:9:in `<main>'
2019-05-14T07:31:55.022993+00:00 app[web.1]: Exiting
2019-05-14T07:31:56.410195+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=warm-harbor-88564.herokuapp.com request_id=5926f399-ce9e-4671-b545-de0eb7dca827 fwd="66.229.63.152" dyno= connect= service= status=503 bytes= protocol=https
2019-05-14T07:31:57.780810+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=warm-harbor-88564.herokuapp.com request_id=7b9663f4-abe7-4281-a41d-f867dc8e5aad fwd="66.229.63.152" dyno= connect= service= status=503 bytes= protocol=https
James Brown
  • 836
  • 7
  • 21
  • try lauching your app in production mode on your compute `rails c production` to get more information about why your app cannot boot – Vincent Rolea May 14 '19 at 08:17
  • `require': cannot load such file -- thin (LoadError)` indicates that you are trying to load the `thin` gem in your application but that is is not in your `Gemfile` anymore. Did you try to add `gem "thin"` to your `Gemfile` and run `bundle install` again? – spickermann May 14 '19 at 08:20
  • @VincentRolea this is the error I get: rails c production /Users/donwydens/.rvm/gems/ruby-2.5.0/gems/railties-5.2.3/lib/rails/application.rb:585:in `validate_secret_key_base': Missing `secret_key_base` for 'production' environment, set this string with `rails credentials:edit` (ArgumentError) – James Brown May 14 '19 at 08:27
  • @spickermann I just added the gem to my Gemfile and it loaded! What exactly is the Thing Gem? Ruby Gem website does not have a home page - links to a dead link... thanks again – James Brown May 14 '19 at 08:31
  • Thanks for reporting the error. This is pretty self explanatory, it looks like you don't have any rails secret key base, try having a look here: https://stackoverflow.com/questions/18556955/heroku-config-secret-key-base-error – Vincent Rolea May 14 '19 at 08:43
  • @ManuelQuintanilla `thin` is a webserver like `puma` many others. I wrote a proper answer because my comment seems to have solved your issue. – spickermann May 14 '19 at 08:47

1 Answers1

1

The error message

require': cannot load such file -- thin (LoadError) 

indicates that you are trying to load the thin gem in your application but that is is not in your referenced in you Gemfile – Perhaps you installed it manually in your development machine or the code that raises the error runs only on the production environment.

Just add the thin gem to you Gemfile

gem 'thin'

run bundle install again and redeploy the changes to Heroku.

spickermann
  • 100,941
  • 9
  • 101
  • 131