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'
Vérifiez dans la liste, 2.7.1 est le dernier?
-> % 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
Mettre à jour rbenv?
-> % brew upgrade rbenv ruby-build
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 4 taps (heroku/brew, homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
C'était la dernière version 2.7.1 La procédure d'un pas en avant n'aurait peut-être pas signifié https://www.ruby-lang.org/ja/downloads/ Ouais, 2.7.1 est activé. Donc N (-> Non).
-> % rbenv install 2.7.1
rbenv: /Users/(username)/.rbenv/versions/2.7.1 already exists
continue with installation? (y/N) N
Mais le projet est 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`
Avec cela, j'ai frappé l'un des éléments suivants.
bundle update --bundler
gem install bundler:1.17.2
Cela m'a gêné pendant que je faisais diverses choses.
-> % 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
Il y avait de nombreux articles qui semblaient être parce que les versions que j'ai recherchées et auxquelles je faisais référence étaient différentes, mais dans mon cas Gemfile
ruby '2.7.1'
Je devais juste le réécrire. bundle install
fonctionne maintenant.
Vient ensuite la mise à niveau de la version de Rails C'est aussi un Gemfile
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
Ensuite, vous pouvez y aller si vous faites budle install
.
-> % 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.
J'ai été grondé.
bundle update
fais le
bundle install
Ensuite, j'ai pu y aller.
Recommended Posts