前提・実現したいこと
Ruby on Rails5のチュートリアルを使って勉強をしています。
現在第3章まで進み、新しいアプリケーションの作成にあたってGemのカスタマイズを行なっているのですが、bundle installやbundle updateを実行してもエラーが発生してしまいます。
まだRubyの学習を初めて二週間程度なので野暮な質問かもしれませんが、チュートリアルを進めることができず困っているのでどうかよろしくお願いします。
発生している問題・エラーメッセージ
#bundle installを実行した場合 You have requested: listen = 3.0.8 The bundle currently has listen locked at 3.1.5. Try running `bundle update listen` If you are updating multiple gems in your Gemfile at once, try passing them all to `bundle update` #bundle update listenを実行した場合 You have requested: spring = 2.0.2 The bundle currently has spring locked at 2.1.0. Try running `bundle update spring` If you are updating multiple gems in your Gemfile at once, try passing them all to `bundle update` #bundle updateを実行した場合 Bundler could not find compatible versions for gem "bundler": In Gemfile: rails (= 5.0.3) was resolved to 5.0.3, which depends on bundler (< 2.0, >= 1.3.0) Current Bundler version: bundler (2.0.2) This Gemfile requires a different version of Bundler. Perhaps you need to update Bundler by running `gem install bundler`? Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (= 5.0.3)', in any of the sources. Bundler could not find compatible versions for gem "listen": In Gemfile: listen (= 3.0.8) guard (= 2.13.0) was resolved to 2.13.0, which depends on listen (<= 4.0, >= 2.7) spring-watcher-listen (= 2.0.1) was resolved to 2.0.1, which depends on listen (< 4.0, >= 2.7) Bundler could not find compatible versions for gem "spring": In Gemfile: spring (= 2.0.2) spring-watcher-listen (= 2.0.1) was resolved to 2.0.1, which depends on spring (< 3.0, >= 1.2)
該当のソースコード
Ruby
1source 'https://rubygems.org' 2 3gem 'rails', '5.0.3' 4gem 'puma', '3.9.1' 5gem 'sass-rails', '5.0.6' 6gem 'uglifier', '3.2.0' 7gem 'coffee-rails', '4.2.2' 8gem 'jquery-rails', '4.3.1' 9gem 'turbolinks', '5.0.1' 10gem 'jbuilder', '2.7.0' 11 12group :development, :test do 13 gem 'sqlite3', '1.3.13' 14 gem 'byebug', '9.0.6', platform: :mri 15end 16 17group :development do 18 gem 'web-console', '3.5.1' 19 gem 'listen', '3.0.8' 20 gem 'spring', '2.0.2' 21 gem 'spring-watcher-listen', '2.0.1' 22end 23 24group :test do 25 gem 'rails-controller-testing', '1.0.2' 26 gem 'minitest-reporters', '1.1.14' 27 gem 'guard', '2.13.0' 28 gem 'guard-minitest', '2.4.4' 29end 30 31group :production do 32 gem 'pg', '0.18.4' 33end
試したこと
・エラーメッセージに表示された通りにListenやSpringのアップデートを試みたのですが、どうやら何度同じコマンドを入力しても、どちらもアップデートされないようです。
・Bundlerのバージョンを変更するためbundler uninstall -vを実行して、現在は2.0.2, 1.7.8がインストールされています。Gemlfile.lockのBUNDLE WITHにはバージョン2.0.2と記載されているのでそれに合わせているのですが、メッセージには私が理解する限りバージョンが2以上では高すぎると書かれているので困惑しています。
・元々のGemfileに記載されていた
<コメント>Windows環境ではtzinfo-dataというgemを含める必要があります
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
という記述は削除しました。
補足情報(FW/ツールのバージョンなど)
ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/07/09 01:31
2019/07/09 01:34