Railsのインストール
Rubyのバージョンアップ、bundlerのインストールも終わったのでRailsのインストールをします。
インストールするRailsのバージョン決定
参考にしている" パーフェクトRuby on Rails" では、Rubyのバージョン2.1.2とRailsバージョン4.1.1を利用していますがなるべく新しいバージョン使っておいた方が後が楽な気がするので参考書とは別バージョンで開発を進めます。
Ruby gems のページを見ると、最新の安定板が4.2.6、rc版が5.0.0.rc1となっています(2016年5月27日現在)。 バージョン5も気になるところですが、今回は4.2.6をインストールします。
All versions of rails | RubyGems.org | your community gem host
Railsのインストール
gemコマンドでインストールします。関連するライブラリが多いので13分かかりました。
$ gem install rails -v 4.2.6 Fetching: rack-1.6.4.gem (100%) Successfully installed rack-1.6.4 Fetching: concurrent-ruby-1.0.2.gem (100%) Successfully installed concurrent-ruby-1.0.2 # 中略 Installing ri documentation for mail-2.6.4 Parsing documentation for actionmailer-4.2.6 Installing ri documentation for actionmailer-4.2.6 Parsing documentation for rails-4.2.6 Installing ri documentation for rails-4.2.6 Done installing documentation for rack, concurrent-ruby, sprockets, thread_safe, tzinfo, i18n, activesupport, mini_portile2, nokogiri, loofah, rails-html-sanitizer, rails-deprecated_sanitizer, rails-dom-testing, rack-test, erubis, builder, actionview, actionpack, sprockets-rails, thor, railties, arel, activemodel, activerecord, globalid, activejob, mime-types-data, mime-types, mail, actionmailer, rails after 778 seconds 31 gems installed
パーフェクトRuby on Rails |
環境
関連記事
全出力
gem install rails -v 4.2.6 したときの全出力を記録のために残しておきます
$ gem install rails -v 4.2.6 Fetching: rack-1.6.4.gem (100%) Successfully installed rack-1.6.4 Fetching: concurrent-ruby-1.0.2.gem (100%) Successfully installed concurrent-ruby-1.0.2 Fetching: sprockets-3.6.0.gem (100%) Successfully installed sprockets-3.6.0 Fetching: thread_safe-0.3.5.gem (100%) Successfully installed thread_safe-0.3.5 Fetching: tzinfo-1.2.2.gem (100%) Successfully installed tzinfo-1.2.2 Fetching: i18n-0.7.0.gem (100%) Successfully installed i18n-0.7.0 Fetching: activesupport-4.2.6.gem (100%) Successfully installed activesupport-4.2.6 Fetching: mini_portile2-2.0.0.gem (100%) Successfully installed mini_portile2-2.0.0 Fetching: nokogiri-1.6.7.2.gem (100%) Building native extensions. This could take a while... Successfully installed nokogiri-1.6.7.2 Fetching: loofah-2.0.3.gem (100%) Successfully installed loofah-2.0.3 Fetching: rails-html-sanitizer-1.0.3.gem (100%) Successfully installed rails-html-sanitizer-1.0.3 Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%) Successfully installed rails-deprecated_sanitizer-1.0.3 Fetching: rails-dom-testing-1.0.7.gem (100%) Successfully installed rails-dom-testing-1.0.7 Fetching: rack-test-0.6.3.gem (100%) Successfully installed rack-test-0.6.3 Fetching: erubis-2.7.0.gem (100%) Successfully installed erubis-2.7.0 Fetching: builder-3.2.2.gem (100%) Successfully installed builder-3.2.2 Fetching: actionview-4.2.6.gem (100%) Successfully installed actionview-4.2.6 Fetching: actionpack-4.2.6.gem (100%) Successfully installed actionpack-4.2.6 Fetching: sprockets-rails-3.0.4.gem (100%) Successfully installed sprockets-rails-3.0.4 Fetching: thor-0.19.1.gem (100%) Successfully installed thor-0.19.1 Fetching: railties-4.2.6.gem (100%) Successfully installed railties-4.2.6 Fetching: arel-6.0.3.gem (100%) Successfully installed arel-6.0.3 Fetching: activemodel-4.2.6.gem (100%) Successfully installed activemodel-4.2.6 Fetching: activerecord-4.2.6.gem (100%) Successfully installed activerecord-4.2.6 Fetching: globalid-0.3.6.gem (100%) Successfully installed globalid-0.3.6 Fetching: activejob-4.2.6.gem (100%) CSuccessfully installed activejob-4.2.6 Fetching: mime-types-data-3.2016.0521.gem (100%) Successfully installed mime-types-data-3.2016.0521 Fetching: mime-types-3.1.gem (100%) Successfully installed mime-types-3.1 Fetching: mail-2.6.4.gem (100%) Successfully installed mail-2.6.4 Fetching: actionmailer-4.2.6.gem (100%) Successfully installed actionmailer-4.2.6 Fetching: rails-4.2.6.gem (100%) Successfully installed rails-4.2.6 Parsing documentation for rack-1.6.4 Installing ri documentation for rack-1.6.4 Parsing documentation for concurrent-ruby-1.0.2 Installing ri documentation for concurrent-ruby-1.0.2 Parsing documentation for sprockets-3.6.0 Installing ri documentation for sprockets-3.6.0 Parsing documentation for thread_safe-0.3.5 Installing ri documentation for thread_safe-0.3.5 Parsing documentation for tzinfo-1.2.2 Installing ri documentation for tzinfo-1.2.2 Parsing documentation for i18n-0.7.0 Installing ri documentation for i18n-0.7.0 Parsing documentation for activesupport-4.2.6 Installing ri documentation for activesupport-4.2.6 Parsing documentation for mini_portile2-2.0.0 Installing ri documentation for mini_portile2-2.0.0 Parsing documentation for nokogiri-1.6.7.2 Installing ri documentation for nokogiri-1.6.7.2 Parsing documentation for loofah-2.0.3 Installing ri documentation for loofah-2.0.3 Parsing documentation for rails-html-sanitizer-1.0.3 Installing ri documentation for rails-html-sanitizer-1.0.3 Parsing documentation for rails-deprecated_sanitizer-1.0.3 Installing ri documentation for rails-deprecated_sanitizer-1.0.3 Parsing documentation for rails-dom-testing-1.0.7 Installing ri documentation for rails-dom-testing-1.0.7 Parsing documentation for rack-test-0.6.3 Installing ri documentation for rack-test-0.6.3 Parsing documentation for erubis-2.7.0 Installing ri documentation for erubis-2.7.0 Parsing documentation for builder-3.2.2 Installing ri documentation for builder-3.2.2 Parsing documentation for actionview-4.2.6 Installing ri documentation for actionview-4.2.6 Parsing documentation for actionpack-4.2.6 Installing ri documentation for actionpack-4.2.6 Parsing documentation for sprockets-rails-3.0.4 Installing ri documentation for sprockets-rails-3.0.4 Parsing documentation for thor-0.19.1 Installing ri documentation for thor-0.19.1 Parsing documentation for railties-4.2.6 Installing ri documentation for railties-4.2.6 Parsing documentation for arel-6.0.3 Installing ri documentation for arel-6.0.3 Parsing documentation for activemodel-4.2.6 Installing ri documentation for activemodel-4.2.6 Parsing documentation for activerecord-4.2.6 Installing ri documentation for activerecord-4.2.6 Parsing documentation for globalid-0.3.6 Installing ri documentation for globalid-0.3.6 Parsing documentation for activejob-4.2.6 Installing ri documentation for activejob-4.2.6 Parsing documentation for mime-types-data-3.2016.0521 Installing ri documentation for mime-types-data-3.2016.0521 Parsing documentation for mime-types-3.1 Installing ri documentation for mime-types-3.1 Parsing documentation for mail-2.6.4 Installing ri documentation for mail-2.6.4 Parsing documentation for actionmailer-4.2.6 Installing ri documentation for actionmailer-4.2.6 Parsing documentation for rails-4.2.6 Installing ri documentation for rails-4.2.6 Done installing documentation for rack, concurrent-ruby, sprockets, thread_safe, tzinfo, i18n, activesupport, mini_portile2, nokogiri, loofah, rails-html-sanitizer, rails-deprecated_sanitizer, rails-dom-testing, rack-test, erubis, builder, actionview, actionpack, sprockets-rails, thor, railties, arel, activemodel, activerecord, globalid, activejob, mime-types-data, mime-types, mail, actionmailer, rails after 778 seconds 31 gems installed