読者です 読者をやめる 読者になる 読者になる

にるぽっぽ

転職.com

Rubyを入れる

RaspbianにRuby入れようとしたらOpenSSL libないって言われたので。

rbenvを入れる

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

※追記 .bash_profileじゃなくて.profileに設定

ruby-buildを入れる

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

Ruby 2.2.0を入れる

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


BUILD FAILED (Raspbian GNU/Linux 7 using ruby-build 20150130-2-g8106d8f)

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

Last 10 log lines:
                              test-unit-3.0.8.gem
                              minitest-5.4.3.gem
                              power_assert-0.2.2.gem
installing rdoc:              /home/hoge/.rbenv/versions/2.2.0/share/ri/2.2.0/system
installing capi-docs:         /home/hoge/.rbenv/versions/2.2.0/share/doc/ruby
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
Configure options used:
  --prefix=/home/hoge/.rbenv/versions/2.2.0
  LDFLAGS=-L/home/hoge/.rbenv/versions/2.2.0/lib
  CPPFLAGS=-I/home/hoge/.rbenv/versions/2.2.0/include

怒られた

OpenSSL libがないっぽい、OpenSSLは既にインストールされていたので

sudo apt-get install libssl-dev

もう一度実行

hoge@rbp01:~$ 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 /home/hoge/.rbenv/versions/2.2.0
hoge@rbp01:~$ rbenv global 2.2.0
hoge@rbp01:~$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [armv7l-linux-eabihf]

終わり