LoginSignup
0
0

More than 3 years have passed since last update.

bundle install、railsコマンド実行時のエラーAn error occurred while installing nokogiri (1.10.10), and Bundler cannot continue. Make sure that `gem install nokogiri -v '1.10.10' --source 'https://rubygems.org/'` succeeds before bundling.の解決法

Last updated at Posted at 2020-11-01

久しぶりにrailsをコマンドを動かすとエラー。

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

上記のエラーが出るとbundle isntallも通らなくなる。

原因

which gem、which rubyでパスが通っていない。

$ which ruby
/usr/bin/ruby

こうしたい↓

$ which ruby 
/Users/shogo/.rbenv/shims/ruby

解決法

rbenvにパスを通すため、シェルの設定ファイル(.bashrcや.zshrc)に以下を追加。

対象アプリのディレクトリで1行ずつ行わなければいけないことに注意。

[[ -d ~/.rbenv  ]] && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"
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