Nitrous.ioのRubyをバージョンアップする
1. インストール可能なバージョンを調べる
$ parts search ruby chruby (0.3.8) Chruby: Changes the current ruby ruby2.1 (2.2.0) Ruby 2.2.0: A dynamic programming language with a focus on simplicity and productivity. ruby2.0 (2.0.0-p576) Ruby 2.0.0: A dynamic programming language with a focus on simplicity and productivity. ruby1.9 (1.9.3-p547) Ruby 1.9.3: A dynamic programming language with a focus on simplicity and productivity. ruby2.2 (2.2.0) Ruby 2.2.0: A dynamic programming language with a focus on simplicity and productivity. ruby_install (0.4.1) Ruby Install: Installs Ruby, JRuby, Rubinius, MagLev or MRuby
2. Rubyをインストール
herokuでも対応している2.2をインストールします。
$ parts install ruby2.2 ... => Activating...
Activating...から進まないので、仕方なくbox再起動しました。
再起動後、rubyバージョンを確認すると、
$ruby -v ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
ちゃんとインストールされてました。
3. Gemfileを編集する
source 'https://rubygems.org' ruby '2.2.0' group :development, :test do gem 'sqlite3' end group :production do gem 'pg' gem 'rails_12factor' end
4. herokuにpushする
$ gem install bundle $ bundle install $ git add Gemfile $ git add Gemfile.lock $ git commit -m "change ruby version" $ git push heroku master