LoginSignup
4
3

More than 5 years have passed since last update.

Gemfileで指定されたRubyのバージョンを変更する

Posted at

自分用メモ。

サーバーが起動しない

bundle exec rails s

を実行すると、

Your Ruby version is 2.5.1, but your Gemfile specified 2.3.3
というエラーが出た。

今回、Gemfileのバージョンを2.5.1にしたかったため、Gemfileを書き換えることにした。

Gemfileを書き換える

ディレクトリ内のGemfileを開く

バージョンは3行目に書かれていた

ruby '2.3.3'

これを2.5.5に直す。

保存して再度サーバー起動を試みるも、
Could not find concurrent-ruby-1.1.1 in any of the sources
Run bundle install to install missing gems.
というエラー発生。

bundle updateの実行

下記のサイトがそのまま役に立った。

http://startonlineeikaiwa.com/programming/2017/01/18/rails-server%E5%AE%9F%E8%A1%8C%E2%86%92%E3%80%8Crun-bundle-install-to-install-missing-gems-%E3%80%8D%E2%86%92bundle-update%E3%81%A7%E8%A7%A3%E6%B1%BA/

bundle update
bundle exec rails s

で解決。

4
3
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
4
3