LoginSignup
30
30

More than 5 years have passed since last update.

Windows(RubyInstaller) + berkshelf 3.0 をインストール(dep-selector-libgecode問題)

Last updated at Posted at 2014-05-30

WindowsでRuby2系は嵌まると評判なので、今回は1.9.3を使いました。

結論としては

  1. DevKitのMSYS(msys.bat)を使う
  2. DevKitのMSYSのtarを置き換える

で入りました。


  • Windows 8.1 64bit
  • ruby 1.9.3 (RubyInstaller 1.9.3p545 (2014-02-24) [i386-mingw32] + RubyInstaller Development Kit)
  • Bundler
  • berkshelf 3.1.2
    • dep-selector-libgecode 1.0.1

Windows(MinGW)上でberkshelf 3をインストールしようとするとdep-selector-libgecodeでエラー発生し進めません。

WindowsでのBerkshelfのインストール成功

原因は、Berkshelfのバージョンでした。大抵Vagrant+Chefで簡単に仮想サーバーが設定できるよ、と書いているサイトは、

gem install berkshelf

とインストールしろ、と書いていますが、Berkselfの最新版をインストールしようとます。これだと途中で Failed to build gecode libraryでビルドで失敗します(この関係するdep-selector-libgecodeというのが何であるのはさっぱりわかりません)。

以前インストールに成功したときのBerkselfのバージョンのメモが残っていました。2.0.14で成功していました。現在の最新版は、rubygems.orgのサイトを見ると3.0.1でしたので、2の系列の最新版は、2.0.15ですので次のようにBerkselfのバージョンを指定してインストールします。

でも、2系と3系だといろいろ違うので、支障が出ます。2で妥協できません。

しばらく嵌まっていたものの、無事インストールできたのでメモっておきます。


configure: error: C++ compiler cannot create executables

原因

mingwのgccが認識されていません。

対策

単にパスだけ通しても、makeでコケました。

DevKitのmsys.batからbashを起動して、その中でインストールします。

minttyを使う場合はショートカットを作成してリンク先を

C:\DevKit\msys.bat -mintty

のようにします。

make: *** [installlib] Error 2

これだけだと、ビルド自体は成功するようですが、最後のmake installでエラーになるようです。

      0 [main] tar 6088 open_stackdumpfile: Dumping stack trace to tar.exe.stackdump
      0 [main] tar 2824 open_stackdumpfile: Dumping stack trace to tar.exe.stackdump
make[1]: *** [doinstallheaders] Error 5
make[1]: Leaving directory `/c/Users/uzuki05/Documents/libgecodetest/vendor/bundle/ruby/1.9.1/gems/dep-selector-libgecode-1.0.1/ext/libgecode3/vendor/gecode-3.7.3'
make: *** [installlib] Error 2
extconf.rb:94:in `block in run': Failed to build gecode library. (GecodeBuild::BuildError)
        from extconf.rb:93:in `chdir'
        from extconf.rb:93:in `run'
        from extconf.rb:100:in `<main>'

試してみます。

cd /c/Users/uzuki05/Documents/libgecodetest/vendor/bundle/ruby/1.9.1/gems/dep-selector-libgecode-1.0.1/ext/libgecode3/vendor/gecode-3.7.3
make install

スクリーンショット 2014-05-30 11.37.57.png

原因

どうもDevKitに含まれるtarが壊れているのか、そこで止まってしまうようです。

対策

Tar for WindowsからBinaries(Zip):tar-1.13-1-bin.zipと[Dependencies(Zip):tar-1.13-1-dep.zipをダウンロードし、展開して得られるファイルをDevKitのディレクトリ(C:\DevKit)に上書きします。

参考 https://github.com/berkshelf/solve/issues/31#issuecomment-40660305

上書き後バージョンを確認します。

$ tar --version
tar (GNU tar) 1.13

Copyright (C) 1988, 92,93,94,95,96,97,98, 1999 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Written by John Gilmore and Jay Fenlason.

結果

無事インストールできました。

uzuki05@Z21 /c/Users/uzuki05/Documents/libgecodetest
$ bundle install --path=vendor/bundle
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Installing dep-selector-libgecode 1.0.1
Using bundler 1.6.2
Your bundle is complete!
It was installed into ./vendor/bundle
30
30
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
30
30