お世話になっております。
投稿サイトのようなweb applicationを完成させ、色んな方に見てもらうためにgithub, herokuを用いてデプロイしようと思い、現在作業しています。
git push heroku master というコマンドを打った瞬間に以下のような写真のエラーが起きてしまいました。
写真で見づらいと思うのですが、ご了承ください。
赤い文字の部分は以下の通りの表記です
remote: ! remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3 remote: !
To https://git.heroku.com/sample77tweetapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/sample77tweetapp.git'
自分で既に行ったこと
-
bundlerのバージョンがherokuのbundlerバージョンとローカルのbundlerのバージョンがあっていないのではと思い、herokuのbundlerバージョンに合わせた (2.2.21)
-
sqlite3がエラー起こしているのではと思い、こちらの記事を参考にしながらpostgresqlに変更しようとファイルなどを書き換えて見たが、完全に完了したのかどうか分からない (結果としてgit push heroku masterでエラーが未だに起きている状況)
https://qiita.com/hmmrjn/items/e2dff8036fbbd74f049a
です。
これからどのようにエラーに対応すれば良いか分からず、皆様に相談させて頂きました。
どうぞ宜しくお願い致します。。
追加内容
Gemfile
source "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.0.2" # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' gem "rails", "~> 6.1.4" # Use sqlite3 as the database for Active Record gem "sqlite3", group: :development gem "pg", group: :production # Use Puma as the app server gem "puma", "~> 5.0" # Use SCSS for stylesheets gem "sass-rails", ">= 6" # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem "webpacker", "~> 5.0" # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem "turbolinks", "~> 5" # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem "jbuilder", "~> 2.7" # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use Active Model has_secure_password gem "bcrypt", "~> 3.1.11" # Use Active Storage variant # gem 'image_processing', '~> 1.2' # Reduces boot times through caching; required in config/boot.rb gem "bootsnap", ">= 1.4.4", require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem "byebug", platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem "web-console", ">= 4.1.0" # Display performance information such as SQL time and flame graphs for each request in your browser. # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md gem "rack-mini-profiler", "~> 2.0" gem "listen", "~> 3.3" # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem "spring" end group :test do # Adds support for Capybara system testing and selenium driver gem "capybara", ">= 3.26" gem "selenium-webdriver" # Easy installation and use of web drivers to run system tests with browsers gem "webdrivers" end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem "pry-rails"
database.yml
# SQLite. Versions 3.8.0 and up are supported. # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem 'sqlite3' # default: &default adapter: sqlite3 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default database: db/development.sqlite3 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default database: db/test.sqlite3 production: <<: *default adapter: postgresql encoding: unicode pool: 5
8/19 18:45現在のエラー表記 (最新、sqliteに関するエラーはクリアした模様)
remote: You have deleted from the Gemfile: remote: * sqlite3 (~> 1.4) remote: Bundler Output: You are trying to install in deployment mode after changing remote: your Gemfile. Run `bundle install` elsewhere and add the remote: updated Gemfile.lock to version control. remote: remote: If this is a development machine, remove the /tmp/build_d55761f7/Gemfile freeze remote: by running ``. remote: remote: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * pg (~> 1.1) remote: remote: You have deleted from the Gemfile: remote: * sqlite3 (~> 1.4) remote: remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to sample77tweetapp. remote: To https://git.heroku.com/sample77tweetapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/sample77tweetapp.git'
最後に赤文字で、"failed to install gems via Bundler"の文字がエラーとして出ている状況です
Bundle installをコマンドした後のエラー内容
Yoshihiros-MacBook-Pro:sample_tweetapp yoshi$ bundle install Fetching source index from https://rubygems.org/ Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.org:443 (Connection refused - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)> Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.org:443 (Connection refused - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)> Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.org:443 (Connection refused - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)> Could not fetch specs from https://rubygems.org/ due to underlying error <Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.org:443 (Connection refused - connect(2) for "rubygems.org" port 443) (https://rubygems.org/specs.4.8.gz)>
回答2件
あなたの回答
tips
プレビュー