げっとシステムログ

WEB開発メモ

Ubuntu14 に ruby 1.9.2-p320 をインストールする

以下、 Ubuntu14.04 に ruby 1.9.2-p320 をインストールした記録

まっさらというわけではない
rbenv はインストール済みでした

とりあえずいきなりインストールしてみる

[shun work]$ rbenv install 1.9.2-p320

ERROR: This package must be compiled with GCC, but ruby-build couldn't
find a suitable `gcc` executable on your system. Please install GCC
and try again.


BUILD FAILED (Ubuntu 14.04 using ruby-build 20160228-5-g522f3ba)

すぐに gcc がないって言われた
前はかなり後で言われた気がするが、 ruby-build のバージョンアップで時間短縮するようになったのかな

[shun work]$ sudo apt-get install gcc

さて、もう一度インストール

[shun work]$ rbenv install 1.9.2-p320
Downloading yaml-0.1.6.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...

BUILD FAILED (Ubuntu 14.04 using ruby-build 20160228-5-g522f3ba)

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

Last 10 log lines:
config.status: creating yaml-0.1.pc
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating tests/Makefile
config.status: creating win32/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
/home/shun/.rbenv/plugins/ruby-build/bin/ruby-build: 行 544: make: コマンドが見つかりません

make ないって

[shun work]$ sudo apt-get install make

もう一回

[shun work]$ rbenv install 1.9.2-p320
Downloading yaml-0.1.6.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/shun/.rbenv/versions/1.9.2-p320

Downloading ruby-1.9.2-p320.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p320.tar.bz2
Installing ruby-1.9.2-p320...
Installed ruby-1.9.2-p320 to /home/shun/.rbenv/versions/1.9.2-p320

Downloading rubygems-1.8.23.tgz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e4a1c6bbaac411eaab94deae78228b7584033a1f10a022f52bffa9613aa29061
Installing rubygems-1.8.23...
Installed rubygems-1.8.23 to /home/shun/.rbenv/versions/1.9.2-p320

ERROR:  Loading command: install (LoadError)
    no such file to load -- zlib
ERROR:  While executing gem ... (NameError)
    uninitialized constant Gem::Commands::InstallCommand
rbenv: error installing gem `bundler'

bundler インストールするときに zlib がないと怒られる

[shun work]$ sudo aptitude install zlib1g-dev

bundler のインストールでのエラーだから ruby のインストールは成功してるので gem install でも良いはずだけど ruby のインストールをもう一回やっちゃった

[shun work]$ rbenv install 1.9.2-p320
rbenv: /home/shun/.rbenv/versions/1.9.2-p320 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.6.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /home/shun/.rbenv/versions/1.9.2-p320

Downloading ruby-1.9.2-p320.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p320.tar.bz2
Installing ruby-1.9.2-p320...
Installed ruby-1.9.2-p320 to /home/shun/.rbenv/versions/1.9.2-p320

Downloading rubygems-1.8.23.tgz...
-> https://dqw8nmjcqpjn7.cloudfront.net/e4a1c6bbaac411eaab94deae78228b7584033a1f10a022f52bffa9613aa29061
Installing rubygems-1.8.23...
Installed rubygems-1.8.23 to /home/shun/.rbenv/versions/1.9.2-p320

Fetching: bundler-1.11.2.gem (100%)
Successfully installed bundler-1.11.2
1 gem installed
Installing ri documentation for bundler-1.11.2...
Installing RDoc documentation for bundler-1.11.2...

完了