LoginSignup
3
2

More than 5 years have passed since last update.

VagrantでIgnoringが連発しておかしくなったのかと思ったら、RubyのGemが古かった話

Posted at

概要

いつの頃からか、vagrant staus / vagrant up などのコマンドをを実行する毎に

Ignoring ffi-1.9.17 because its extensions are not built.  Try: gem pristine ffi --version 1.9.17
Ignoring nokogiri-1.6.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.7.1
Ignoring unf_ext-0.0.7.2 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.2

というWarningが常に出続けるようになってしまった。
Vagrantの再インストールでIgnoringエラーが発生するを実行しても上手くいかず。
色々調べた結果本当にインストール出来ていなかっただけというお話。

調査

Ignoring nokogiri-1.6.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.7.1

上記のエラーが表示されているので、素直に実行してみることに。すると

gem pristine nokogiri --version 1.6.7.1
ERROR:  While executing gem ... (Gem::Exception)
    Failed to find gems ["nokogiri"] = 1.6.7.1

gemがnokogiriの該当のVersionのものを見つけられないよ、と言っているように見える。
なので、とりあえあう最新版へUpdateしてみよう。

gem update
Updating nokogiri
ERROR:  Error installing nokogiri:
    nokogiri requires Ruby version >= 2.1.0.

などと表示されてしまう。
nokogiriを入れるにはRubyのVersionが古いようだ。

ruby --version
ruby 2.0.0p576 (2014-09-19 revision 47628) [x86_64-darwin12.6.0]

RubyのVersionが古いように見える。

rbenv versions
  system
  1.9.3-p194
  1.9.3-p362
* 2.0.0-p576 (set by /Users/xxxxxx/.ruby-version)

古いように見える。
なので、RubyもUpdatをする。

rbenv install 2.4.2
ruby-build: use openssl from homebrew
Downloading ruby-2.4.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.2.tar.bz2
Installing ruby-2.4.2...
ruby-build: use readline from homebrew
Installed ruby-2.4.2 to /Users/xxxxxx/.rbenv/versions/2.4.2

最新と思われる2.4.2のインストールを完了した。
引き続き、使用するRubyのVersionを変更する。

rbenv local 2.4.2
rbenv versions
  system
  1.9.3-p194
  1.9.3-p362
  2.0.0-p576
  2.2.0-dev
* 2.4.2 (set by /Users/xxxxxx/MICE/git/Local/.ruby-version)

設定変更完了。

gem update

を実行してGems updatedと表示されることを確認。
満を持して、vagrant statusを実行する。

vagrant status
Ignoring ffi-1.9.17 because its extensions are not built.  Try: gem pristine ffi --version 1.9.17
Ignoring nokogiri-1.6.7.1 because its extensions are not built.  Try: gem pristine nokogiri --version 1.6.7.1
Ignoring unf_ext-0.0.7.2 because its extensions are not built.  Try: gem pristine unf_ext --version 0.0.7.2

そんな馬鹿な

vagrant の install時にgemが必要だったのではないか?と考え、再度Uninstall/installを実行する

brew cask uninstall vagrant
==> Uninstalling Cask vagrant
==> Running uninstall process for vagrant; your password may be necessary
==> Running uninstall script uninstall.tool
Password:
==> The following files and directories will be removed:
==>     /opt/vagrant
==>     /usr/local/bin/vagrant
==>
==> Do you wish to uninstall Vagrant (Yes/No)?
==> The uninstallation process requires administrative privileges
==> because some of the installed files cannot be removed by a
==> normal user. You may now be prompted for a password...
==>
==>
==> Successfully uninstalled Vagrant.
==> Done.
==> Press any key to exit.
==> Uninstalling packages:
com.vagrant.vagrant

brew cask install vagrant
==> Satisfying dependencies
==> Downloading https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.dmg
Already downloaded: /Users/xxxxxx/Library/Caches/Homebrew/Cask/vagrant--2.0.1.dmg
==> Verifying checksum for Cask vagrant
==> Installing Cask vagrant
==> Running installer for vagrant; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> installer: Package name is Vagrant
==> installer: Installing at base path /
==> installer: The install was successful.
🍺  vagrant was successfully installed!

再度、 vagrant status を実行!

vagrant status
Current machine states:

xxx-xxxx                  poweroff (virtualbox)

Ignoringのエラーが表示されなくなりました。めでたしめでたし。

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