LoginSignup
0

More than 3 years have passed since last update.

railsのバージョン変更する

Last updated at Posted at 2019-11-29

cloneしたgemfileのバージョンにrailsのバージョンを合わせたい

該当のバージョンをインスール

$ gem install -v 5.2.1 rails

エラーが起きる

gem install -v  5.2.1 rails
ERROR:  Error installing rails:
        The last version of sprockets (>= 3.0.0) to support your Ruby & RubyGems was 3.7.2. Try installing it with `gem install sprockets -v 3.7.2` and then running the current command again
        sprockets requires Ruby version >= 2.5.0. The current ruby version is 2.4.2.198.

rubyのバージョンを変更したので、それに合わせて

gemのアップデート
$ gem update --systems
新しくインストールしたrubyの環境にbundleを入れる
$ gem install bundler

そして先ほどのエラー文を読むと

gem install sprockets -v 3.7.2

してください。となっていたのでこれを実行する。

もう一度

$ gem install -v 5.2.1 rails

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
0