いつもお世話になっております。
Rails5で作っていたアプリケーションのDBをPostgreSQLからMySQLに変更しpushしたところ、エラーが出ました。
何が原因なのかよくわからないので、ご教授いただければと思います。
$ git push heroku master remote: -----> Ruby app detected remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.3.4 remote: -----> Installing dependencies using bundler 1.15.2 remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment remote: Your Gemfile lists the gem mysql2 (~> 0.3.20) more than once. remote: You should probably keep only one of them. remote: While it's not a problem now, it could cause errors if you change the version of one of them later. remote: 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: The dependencies in your gemfile changed remote: You have added to the Gemfile: remote: * mysql2 (~> 0.3.20) remote: * mysql2 (~> 0.3.20) remote: You have deleted from the Gemfile: remote: * mysql2 remote: * pg (= 0.18.4) remote: Bundler Output: Your Gemfile lists the gem mysql2 (~> 0.3.20) more than once. remote: You should probably keep only one of them. remote: While it's not a problem now, it could cause errors if you change the version of one of them later. remote: 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: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * mysql2 (~> 0.3.20) remote: * mysql2 (~> 0.3.20) remote: remote: You have deleted from the Gemfile: remote: * mysql2 remote: * pg (= 0.18.4) 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 xxx. remote: To https://git.heroku.com/xxx.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/xxx.git'
ruby
1#Gemfile 2source 'https://rubygems.org' 3 4gem 'rails', '5.0.0.1' 5gem 'puma', '3.4.0' 6gem 'sass-rails', '5.0.6' 7gem 'uglifier', '3.0.0' 8gem 'coffee-rails', '4.2.1' 9gem 'jquery-rails', '4.1.1' 10gem 'turbolinks', '5.0.1' 11gem 'jbuilder', '2.4.1' 12 13group :development, :test do 14 gem 'byebug', '9.0.0', platform: :mri 15 gem 'mysql2', '~> 0.3.20' 16end 17 18group :development do 19 gem 'web-console', '3.1.1' 20 gem 'listen', '3.0.8' 21 gem 'spring', '1.7.2' 22 gem 'spring-watcher-listen', '2.0.0' 23end 24 25group :production do 26 gem 'mysql2', '~> 0.3.20' 27end
**追記**
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: The dependencies in your gemfile changed remote: You have added to the Gemfile: remote: * mysql2 (~> 0.3.20) remote: You have deleted from the Gemfile: remote: * mysql2 remote: * pg (= 0.18.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: The dependencies in your gemfile changed remote: remote: You have added to the Gemfile: remote: * mysql2 (~> 0.3.20) remote: remote: You have deleted from the Gemfile: remote: * mysql2 remote: * pg (= 0.18.4)
Heroku側でのbundle install
は実行しましたが、mysqlではなくpostgresqlが読まれているようです。
どうぞよろしくお願い致します。
回答2件
あなたの回答
tips
プレビュー