まっしろけっけ

めもてきなやーつ

Ruby2.2.0のインストールがlibffi.a: could not read symbols: Bad valueで失敗した件

Ruby 2.2.0 Released

素晴らしいクリスマスプレゼント!!
twitter見ている感じだと開発者の皆さんは大変だったようでお疲れ様でした+ありがとうございます。
Let's Install

install

Rubyのversion管理はrbenv使ってます。


rbenvでrubyのversion管理をするよ - まっしろけっけ

rubyのversion upをした時の作業内容メモ - まっしろけっけ


詳細は上記の記事を参照してください。
環境はvm上にCnetOS入れてます。

$ rbenv install 2.2.0
Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...

BUILD FAILED (CentOS release 6.5 (Final) using ruby-build 20141222-4-ge455975)

Inspect or clean up the working tree at /tmp/ruby-build.20141225151244.8260
Results logged to /tmp/ruby-build.20141225151244.8260.log

Last 10 log lines:
make[3]: Leaving directory `/tmp/ruby-build.20141225151244.8260/ruby-2.2.0/ext/fiddle/libffi-3.2.1'
linking shared-object fiddle.so
/usr/bin/ld: ./libffi-3.2.1/.libs/libffi.a(raw_api.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC
./libffi-3.2.1/.libs/libffi.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-linux/fiddle.so] Error 1
make[2]: Leaving directory `/tmp/ruby-build.20141225151244.8260/ruby-2.2.0/ext/fiddle'
make[1]: *** [ext/fiddle/all] Error 2
make[1]: Leaving directory `/tmp/ruby-build.20141225151244.8260/ruby-2.2.0'
make: *** [build-ext] Error 2

エラー出た・・・

libffi-develを入れる

libffi.a: could not read symbols: Bad valueとかエラー出て困った。
twitterを漁っていると・・・


柴田さんありがとうございますmm

ということでlibffi-develを入れてリトライ

$ sudo yum install libffi-devel
$ rbenv install 2.2.0
Downloading ruby-2.2.0.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...
Installed ruby-2.2.0 to /hoge/.rbenv/versions/2.2.0
$ rbenv global 2.2.0
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]

入ったー

$ gem install bundler # とりあえずbundlerいれるよね

明日は会社の環境でもinstallして動作確認とかしてみよう