6
11

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 5 years have passed since last update.

rubyのversionが違くて、bundle installできなかったのは、bundlerが不在だからでした。

Posted at

実行したコマンドなど

$ bundle install --path=vendor/bundle

エラー内容

Your Ruby version is 2.3.3, but your Gemfile specified 2.3.1

状況

ruby -v では 2.3.1 が表示される。
→PATHの問題か??

ーーーーーー

PATHの確認

$ which ruby
→```
/Users/ysk/.rbenv/shims



→``/Users/ysk/.rbenv/shims``を参照している。

ーーーーーー

``
$ echo $PATH
``
→```
/Users/ysk/.nodebrew/current/bin:/Users/ysk/.rbenv/shims:/usr/local/bin:hogehogehoge

 →/User/ysk/.rbenv/shimsを参照するはず。

→rubyのバージョンは整合性が取れている。

解決方法

which bundler してみたら、bundlerがshimsの中になかったので、
bundle installも自動的に下位のディレクトリ/usr/local/binを参照していた。
(/usr/local/binの中のrubyのバージョンは2.3.3だった)

なので
cd /Users/ysk/.rbenv/shims
gem install bundler
叩いてbundlerを入れて、

bundle install --path=vendor/bundle
で通った。

備考・参考

この辺見たけど全然解決しないよ!!ってなったけど、
もっと初歩の初歩でした。


6
11
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
6
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?