1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Rails実行時にGemfileとのバージョン違いのエラーが出る

Last updated at Posted at 2023-06-03

これの続きをやっていて、
他のPCで作業しているソースを持ってきてたんだけど、エラーでハマったのでメモ。

事象

Rails実行時にGemfileとのバージョン違いのエラーが出る。

$ bundle exec rails s
Your Ruby version is 2.6.8, but your Gemfile specified 3.2.2

バージョンを確認しても、2.6.8が存在しない。

$ ruby --version
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin19]
$ ruby --version
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin21]
mitsuaki1229@mitsuaki1229-mba:~/Documents/source/VesselTracking (main *)$ rbenv local
3.2.2
mitsuaki1229@mitsuaki1229-mba:~/Documents/source/VesselTracking (main *)$ rbenv global
2.6.5
$ rbenv versions
  system
  2.6.5
  2.7.1
  3.2.0
* 3.2.2 (set by /Users/mitsuaki1229/Documents/source/VesselTracking/.ruby-version)

原因

bundle installを忘れていた()

対応

$ bundle install --path=.bundle

感想

エラーメッセージちょっと分かりづらいかな。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?