LoginSignup
0
0

More than 3 years have passed since last update.

Rubyのバージョン指定があるプロジェクトで良くあるエラーと対処法

Last updated at Posted at 2019-04-11
rbenv global 2.3.0 

などで、プロジェクトに応じてバージョンを下げた際に起こるエラーに対しての対処法。

$ rails s
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.3.0
  2.3.1
  2.6.2

こんなエラーが出てしまった・・・・・

対処法

gem i -v 5.1.3 rails

これでもだめ、、、、、、


Gemfile.lockにあるbundlerのバージョンに合わせて、インストール

$ gem install bundler -v 1.3.0

これで行けた!!
ただ、bundle installする時に、エラー文に沿ってGemfileの修正が必要。

An error occurred while installing nokogiri (1.8.4), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.8.4' --source
'https://rubygems.org/'` succeeds before bundling.

これで解決
bundle config build.nokogiri --use-system-libraries
0
0
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
0
0