https://qiita.com/kanacan/items/c1499f6c13b1c41da982
Gemfile
ruby '2.6.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.4', '>= 5.2.4.3'
Check in der Liste, 2.7.1 ist die neueste?
-> % rbenv install --list
2.5.8
2.6.6
2.7.1
jruby-9.2.12.0
maglev-1.0.0
mruby-2.1.1
rbx-5.0
truffleruby-20.1.0
truffleruby+graalvm-20.1.0
Rbenv aktualisieren?
-> % brew upgrade rbenv ruby-build
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (heroku/brew, homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
Es war die neueste Version 2.7.1 Das Verfahren in einem Schritt hätte möglicherweise nicht bedeutet https://www.ruby-lang.org/ja/downloads/ Ja, 2.7.1 ist eingeschaltet. Also N (-> Nein).
-> % rbenv install 2.7.1
rbenv: /Users/(username)/.rbenv/versions/2.7.1 already exists
continue with installation? (y/N) N
Das Projekt ist aber 2.6.3. .. ..
-> % rbenv versions
system
2.3.7
2.3.8
2.5.1
2.5.3
* 2.6.3 (set by /Users/(username)/projects/import_agent_app/.ruby-version)
2.6.5
2.6.6
2.7.1
-> % git checkout -b feature/version_up
Switched to a new branch 'feature/version_up'
-> % rbenv local 2.7.1
[feature/version_up *]
-> % rbenv versions
system
2.3.7
2.3.8
2.5.1
2.5.3
2.6.3
2.6.5
2.6.6
* 2.7.1 (set by /Users/(username)/projects/import_agent_app/.ruby-version)
-> % bundle install
Traceback (most recent call last):
2: from /Users/(username)/.rbenv/versions/2.7.1/bin/bundle:23:in `<main>'
1: from /Users/(username)/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/Users/(username)/.rbenv/versions/2.7.1/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.2) required by your /Users/(username)/projects/import_agent_app/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.2`
Damit habe ich eine der folgenden Tasten getroffen.
bundle update --bundler
gem install bundler:1.17.2
Dies störte mich, während ich verschiedene Dinge tat.
-> % bundle install
/Users/(username)/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
Your Ruby version is 2.7.1, but your Gemfile specified 2.6.3
Es gab viele Artikel, die zu sein schienen, weil die Versionen, die ich nachgeschlagen und referenziert habe, unterschiedlich waren, aber in meinem Fall Gemfile
ruby '2.7.1'
Ich musste es nur umschreiben. bundle install
funktioniert jetzt.
Als nächstes folgt das Upgrade der Rails-Version Dies ist auch eine Gemfile
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
Dann können Sie gehen, wenn Sie "Budle Install" machen.
-> % bundle install
/Users/(username)/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:200: warning: constant Gem::ConfigMap is deprecated
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
In snapshot (Gemfile.lock):
activesupport (= 5.2.4.3)
In Gemfile:
rails (~> 6.0.3, >= 6.0.3.3) was resolved to 6.0.3.3, which depends on
activesupport (= 6.0.3.3)
web-console (>= 3.3.0) was resolved to 3.7.0, which depends on
railties (>= 5.0) was resolved to 5.2.4.3, which depends on
activesupport (= 5.2.4.3)
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
Ich wurde gescholten.
bundle update
Tu es
bundle install
Dann konnte ich gehen.
Recommended Posts