前提・実現したいこと
システムを作り終わり、ローカル環境では作動できています。
デプロイを行いたいです。
発生している問題・エラーメッセージ
2019-10-13T10:54:00.700089+00:00 heroku[web.1]: State changed from crashed to starting 2019-10-13T10:54:02.970809+00:00 heroku[web.1]: Starting process with command `bundle exec rackup config.ru -p 4528` 2019-10-13T10:54:04+00:00 app[api]: Build succeeded 2019-10-13T10:54:05.998174+00:00 heroku[web.1]: Process exited with status 1 2019-10-13T10:54:06.038336+00:00 heroku[web.1]: State changed from starting to crashed 2019-10-13T10:54:06.041579+00:00 heroku[web.1]: State changed from crashed to starting 2019-10-13T10:54:05.936829+00:00 app[web.1]: bundler: failed to load command: rackup (/app/vendor/bundle/ruby/2.5.0/bin/rackup) 2019-10-13T10:54:05.936859+00:00 app[web.1]: LoadError: Error loading the 'postgresql' Active Record adapter. Missing a gem it depends on? pg is not part of the bundle. Add it to your Gemfile. 2019-10-13T10:54:05.936862+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:406:in `block (2 levels) in replace_gem' 2019-10-13T10:54:05.936864+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:4:in `<top (required)>' 2019-10-13T10:54:05.936866+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' 2019-10-13T10:54:05.936868+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `block in require' 2019-10-13T10:54:05.93687+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:291:in `load_dependency' 2019-10-13T10:54:05.936872+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activesupport-6.0.0/lib/active_support/dependencies.rb:325:in `require' 2019-10-13T10:54:05.936874+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/connection_specification.rb:170:in `spec' 2019-10-13T10:54:05.936876+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:1044:in `establish_connection' 2019-10-13T10:54:05.936878+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/activerecord-6.0.0/lib/active_record/connection_handling.rb:51:in `establish_connection' 2019-10-13T10:54:05.93688+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/sinatra-activerecord-2.0.14/lib/sinatra/activerecord.rb:50:in `database='
Backtrace
Errno::ENOENT: No such file or directory - /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/bundler /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/find.rb:43:in `block in find' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/find.rb:43:in `collect!' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/find.rb:43:in `find' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli/doctor.rb:103:in `each' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli/doctor.rb:103:in `check_home_permissions' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli/doctor.rb:81:in `run' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli.rb:663:in `doctor' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor.rb:387:in `dispatch' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli.rb:27:in `dispatch' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/vendor/thor/lib/thor/base.rb:466:in `start' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/cli.rb:18:in `start' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:30:in `block in <top (required)>' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/2.6.0/bundler/friendly_errors.rb:124:in `with_friendly_errors' /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-1.17.2/exe/bundle:22:in `<top (required)>' /home/lit_users/.rbenv/versions/2.6.2/bin/bundle:23:in `load' /home/lit_users/.rbenv/versions/2.6.2/bin/bundle:23:in `<main>'
Environment
Bundler 1.17.2 Platforms ruby, x86_64-linux Ruby 2.6.2p47 (2019-03-13 revision 67232) [x86_64-linux] Full Path /home/lit_users/.rbenv/versions/2.6.2/bin/ruby Config Dir /home/lit_users/.rbenv/versions/2.6.2/etc RubyGems 3.0.3 Gem Home /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0 Gem Path /home/lit_users/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0:/home/lit_users/.gem/ruby/2.6.0 User Path /home/lit_users/.gem/ruby/2.6.0 Bin Dir /home/lit_users/.rbenv/versions/2.6.2/bin Tools Git 2.17.1 RVM not installed rbenv rbenv 1.1.2-2-g4e92322 chruby not installed
Bundler Build Metadata
Built At 2018-12-19 Git SHA 3fc4de72b Released Version false
Bundler settings
without Set for your local app (/home/lit_users/workspace/.bundle/config): [:production]
Gemfile
Gemfile
ruby
1source 'https://rubygems.org' 2 3gem 'rake' 4gem 'sinatra' 5gem 'sinatra-contrib' 6gem 'activerecord', "< 5.0.0" 7gem 'sinatra-activerecord' 8gem 'rails_12factor', group: :production 9gem 'nokogiri' 10gem 'cloudinary' 11 12gem 'dotenv' 13 14group :development do 15 gem 'sqlite3' 16end 17 18group :production do 19 gem 'pg', '0.20.0' 20end 21 22# source "https://rubygems.org" 23 24# gem 'rake' 25# gem 'sinatra' 26# gem 'sinatra-contrib' 27# gem "activerecord", "< 5.0.0" 28# gem 'sinatra-activerecord' 29# gem 'rails_12factor', group: :production 30# group :development do 31# gem 'sqlite3' 32# end 33 34# group :production do 35# gem 'pg', '0.20.0' 36# end
Gemfile.lock
GEM remote: https://rubygems.org/ specs: activemodel (4.2.11.1) activesupport (= 4.2.11.1) builder (~> 3.1) activerecord (4.2.11.1) activemodel (= 4.2.11.1) activesupport (= 4.2.11.1) arel (~> 6.0) activesupport (4.2.11.1) i18n (~> 0.7) minitest (~> 5.1) thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.4) aws_cf_signer (0.1.3) backports (3.15.0) builder (3.2.3) cloudinary (1.12.0) aws_cf_signer rest-client concurrent-ruby (1.1.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.7.5) http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) i18n (0.9.5) concurrent-ruby (~> 1.0) mime-types (3.3) mime-types-data (~> 3.2015) mime-types-data (3.2019.1009) mini_portile2 (2.4.0) minitest (5.12.2) multi_json (1.13.1) mustermann (1.0.3) netrc (0.11.0) nokogiri (1.10.4) mini_portile2 (~> 2.4.0) pg (0.20.0) rack (2.0.7) rack-protection (2.0.7) rack rails_12factor (0.0.3) rails_serve_static_assets rails_stdout_logging rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) rake (13.0.0) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) sinatra (2.0.7) mustermann (~> 1.0) rack (~> 2.0) rack-protection (= 2.0.7) tilt (~> 2.0) sinatra-activerecord (2.0.14) activerecord (>= 3.2) sinatra (>= 1.0) sinatra-contrib (2.0.7) backports (>= 2.8.2) multi_json mustermann (~> 1.0) rack-protection (= 2.0.7) sinatra (= 2.0.7) tilt (~> 2.0) sqlite3 (1.4.1) thread_safe (0.3.6) tilt (2.0.10) tzinfo (1.2.5) thread_safe (~> 0.1) unf (0.1.4) unf_ext unf_ext (0.0.7.6) PLATFORMS ruby DEPENDENCIES activerecord (< 5.0.0) cloudinary dotenv nokogiri pg (= 0.20.0) rails_12factor rake sinatra sinatra-activerecord sinatra-contrib sqlite3 BUNDLED WITH 1.17.2
###追記 Heroku run bundle config の結果
Settings are listed in order of priority. The top value will be used. frozen Set for your local app (/app/.bundle/config): true Set for the current user (/app/.bundle/config): true path Set for your local app (/app/.bundle/config): "vendor/bundle" Set for the current user (/app/.bundle/config): "vendor/bundle" bin Set for your local app (/app/.bundle/config): "vendor/bundle/bin" Set for the current user (/app/.bundle/config): "vendor/bundle/bin" jobs Set for your local app (/app/.bundle/config): 4 Set for the current user (/app/.bundle/config): 4 clean Set for your local app (/app/.bundle/config): false Set for the current user (/app/.bundle/config): false without Set for your local app (/app/.bundle/config): [:development, :test, :production] Set for the current user (/app/.bundle/config): [:development, :test, :production] gemfile Set via BUNDLE_GEMFILE: "/app/Gemfile"
試したこと
Gemバージョンの指定
補足情報(FW/ツールのバージョンなど)
####開発環境
VSCODE
Docker
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/10/14 00:01
2019/10/14 23:38
2019/10/20 14:58