目次
RVM(Ruby Version Manager)によるRubyのインストール
RVM(Ruby Version Manager) のインストール
$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB $ \curl -sSL https://get.rvm.io | bash -s stable
# tomoyan,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
Upgrade Notes:
* WARNING: You have '~/.profile' file, you might want to load it,
to do that add the following line to '/home/tomoyan/.bash_profile':
source ~/.profile
* No new notes to display.
インストールが完了したら rvm を読み込む。
$ source ~/.bash_profile
$ rvm version
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
Ruby のビルドに必要なパッケージのインストール
$ mkdir ~/work
$ cd ~/work
$ yumdownloader --source ruby
$ sudo yum-builddep ruby-2.2.2-40.fc22.src.rpm
Ruby のインストール
$ rvm install 2.2.2
$ rvm install 2.2.2
Searching for binary rubies, this might take some time.
No binary rubies available for: fedora/22/x86_64/ruby-2.2.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for fedora.
Installing requirements for fedora.
Installing required packages: libtool, bison..tomoyan password required for 'yum install -y libtool bison':
.....
Requirements installation successful.
Installing Ruby from source to: /home/tomoyan/.rvm/rubies/ruby-2.2.2, this may take a while depending on your cpu(s)...
ruby-2.2.2 - #downloading ruby-2.2.2, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12.6M 100 12.6M 0 0 131k 0 0:01:39 0:01:39 --:--:-- 247k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.2 - #extracting ruby-2.2.2 to /home/tomoyan/.rvm/src/ruby-2.2.2....
ruby-2.2.2 - #configuring.........................................................
ruby-2.2.2 - #post-configuration..
ruby-2.2.2 - #compiling................................................................................
ruby-2.2.2 - #installing..................
ruby-2.2.2 - #making binaries executable..
ruby-2.2.2 - #downloading rubygems-2.4.8
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 437k 100 437k 0 0 179k 0 0:00:02 0:00:02 --:--:-- 179k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.2 - #extracting rubygems-2.4.8....
ruby-2.2.2 - #removing old rubygems.........
ruby-2.2.2 - #installing rubygems-2.4.8......................
ruby-2.2.2 - #gemset created /home/tomoyan/.rvm/gems/ruby-2.2.2@global
ruby-2.2.2 - #importing gemset /home/tomoyan/.rvm/gemsets/global.gems...............................................
ruby-2.2.2 - #generating global wrappers........
ruby-2.2.2 - #gemset created /home/tomoyan/.rvm/gems/ruby-2.2.2
ruby-2.2.2 - #importing gemsetfile /home/tomoyan/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.2 - #generating default wrappers........
ruby-2.2.2 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.2.2 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
Ruby バージョンの切り替え
Ruby 2.2.2 をデフォルトにする。
$ rvm use 2.2.2 --default Using /home/tomoyan/.rvm/gems/ruby-2.2.2 $ ruby -v ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]