さて、今日はrubyの環境とRuby on railsを入れておこう。
ここを参考に。
ちょっと書いてある内容と差分があったのでメモ
1) rvm requirements
以下のように必要なパッケージを自動でインストールしてくれた
~$ rvm requirements
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..........................................................................................................
Installing required packages: gawk, g++, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev..................................................................................................................................
Requirements installation successful.
2) rubyのインストール
rubyのサイトを見るとまだ安定版は1.9.3のようなので、1.9.3をインストール。
~$ rvm install 1.9.3
かなり時間がかかると書いてましたが、数分程度でした。
~$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
3) gemsのインストール
~$ gem -v
2.1.10
4) railsのインストール
これはちょっと時間がかかる。
~$ gem install rails
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.8.2.gem (100%)
Successfully installed multi_json-1.8.2
Fetching: tzinfo-0.3.38.gem (100%)
Successfully installed tzinfo-0.3.38
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: atomic-1.1.14.gem (100%)
Building native extensions. This could take a while...
Successfully installed atomic-1.1.14
Fetching: thread_safe-0.1.3.gem (100%)
Successfully installed thread_safe-0.1.3
Fetching: activesupport-4.0.0.gem (100%)
Successfully installed activesupport-4.0.0
Fetching: builder-3.1.4.gem (100%)
Successfully installed builder-3.1.4
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: rack-test-0.6.2.gem (100%)
Successfully installed rack-test-0.6.2
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: actionpack-4.0.0.gem (100%)
Successfully installed actionpack-4.0.0
Fetching: activemodel-4.0.0.gem (100%)
Successfully installed activemodel-4.0.0
Fetching: arel-4.0.1.gem (100%)
Successfully installed arel-4.0.1
Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
Successfully installed activerecord-deprecated_finders-1.0.3
Fetching: activerecord-4.0.0.gem (100%)
Successfully installed activerecord-4.0.0
Fetching: mime-types-1.25.gem (100%)
Successfully installed mime-types-1.25
Fetching: polyglot-0.3.3.gem (100%)
Successfully installed polyglot-0.3.3
Fetching: treetop-1.4.15.gem (100%)
Successfully installed treetop-1.4.15
Fetching: mail-2.5.4.gem (100%)
Successfully installed mail-2.5.4
Fetching: actionmailer-4.0.0.gem (100%)
Successfully installed actionmailer-4.0.0
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
Fetching: railties-4.0.0.gem (100%)
Successfully installed railties-4.0.0
Fetching: hike-1.2.3.gem (100%)
Successfully installed hike-1.2.3
Fetching: tilt-1.4.1.gem (100%)
Successfully installed tilt-1.4.1
Fetching: sprockets-2.10.0.gem (100%)
Successfully installed sprockets-2.10.0
Fetching: sprockets-rails-2.0.1.gem (100%)
Successfully installed sprockets-rails-2.0.1
Fetching: rails-4.0.0.gem (100%)
Successfully installed rails-4.0.0
Installing ri documentation for actionmailer-4.0.0
Installing ri documentation for actionpack-4.0.0
Installing ri documentation for activemodel-4.0.0
Installing ri documentation for activerecord-4.0.0
Installing ri documentation for activerecord-deprecated_finders-1.0.3
Installing ri documentation for activesupport-4.0.0
Installing ri documentation for arel-4.0.1
Installing ri documentation for atomic-1.1.14
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/performance.rb, skipping
Installing ri documentation for builder-3.1.4
Installing ri documentation for erubis-2.7.0
Installing ri documentation for hike-1.2.3
Installing ri documentation for i18n-0.6.5
Installing ri documentation for mail-2.5.4
Installing ri documentation for mime-types-1.25
Installing ri documentation for minitest-4.7.5
Installing ri documentation for multi_json-1.8.2
Installing ri documentation for polyglot-0.3.3
unable to convert "\x89" from ASCII-8BIT to UTF-8 for test/multipart/binary, skipping
Installing ri documentation for rack-1.5.2
Installing ri documentation for rack-test-0.6.2
Installing ri documentation for rails-4.0.0
Installing ri documentation for railties-4.0.0
Installing ri documentation for sprockets-2.10.0
Installing ri documentation for sprockets-rails-2.0.1
Installing ri documentation for thor-0.18.1
Installing ri documentation for thread_safe-0.1.3
Installing ri documentation for tilt-1.4.1
Installing ri documentation for treetop-1.4.15
Installing ri documentation for tzinfo-0.3.38
28 gems installed
なんか、ASCII-8BIT から UTF-8 の変換ができんとかいってるけど、無視かな。
~$ rails -v
Rails 4.0.0
おっと、今だと4.0.0がインストールされるのか。
<終了>
と、ここまで20分程度。すごく簡単に完了。依存関係とかで結構はまった経験があるのだが、rvmからの手順だとあったりなのね。それともubuntuだからなのか?
先々は、apache + passengaerで動かそうと思ってる。rvmだと個人の環境にインストールされるが、システムへのインストールとかもできるのかなとおもって調べたら、rootで入れれば/usr/local/rvmにインストールされるのね。便利ねぇ。
ここを参考に。
ちょっと書いてある内容と差分があったのでメモ
1) rvm requirements
以下のように必要なパッケージを自動でインストールしてくれた
~$ rvm requirements
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system..........................................................................................................
Installing required packages: gawk, g++, libreadline6-dev, zlib1g-dev, libssl-dev, libyaml-dev, libsqlite3-dev, sqlite3, autoconf, libgdbm-dev, libncurses5-dev, automake, libtool, bison, libffi-dev..................................................................................................................................
Requirements installation successful.
2) rubyのインストール
rubyのサイトを見るとまだ安定版は1.9.3のようなので、1.9.3をインストール。
~$ rvm install 1.9.3
かなり時間がかかると書いてましたが、数分程度でした。
~$ ruby -v
ruby 1.9.3p448 (2013-06-27 revision 41675) [x86_64-linux]
3) gemsのインストール
~$ gem -v
2.1.10
4) railsのインストール
これはちょっと時間がかかる。
~$ gem install rails
Fetching: i18n-0.6.5.gem (100%)
Successfully installed i18n-0.6.5
Fetching: multi_json-1.8.2.gem (100%)
Successfully installed multi_json-1.8.2
Fetching: tzinfo-0.3.38.gem (100%)
Successfully installed tzinfo-0.3.38
Fetching: minitest-4.7.5.gem (100%)
Successfully installed minitest-4.7.5
Fetching: atomic-1.1.14.gem (100%)
Building native extensions. This could take a while...
Successfully installed atomic-1.1.14
Fetching: thread_safe-0.1.3.gem (100%)
Successfully installed thread_safe-0.1.3
Fetching: activesupport-4.0.0.gem (100%)
Successfully installed activesupport-4.0.0
Fetching: builder-3.1.4.gem (100%)
Successfully installed builder-3.1.4
Fetching: rack-1.5.2.gem (100%)
Successfully installed rack-1.5.2
Fetching: rack-test-0.6.2.gem (100%)
Successfully installed rack-test-0.6.2
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: actionpack-4.0.0.gem (100%)
Successfully installed actionpack-4.0.0
Fetching: activemodel-4.0.0.gem (100%)
Successfully installed activemodel-4.0.0
Fetching: arel-4.0.1.gem (100%)
Successfully installed arel-4.0.1
Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
Successfully installed activerecord-deprecated_finders-1.0.3
Fetching: activerecord-4.0.0.gem (100%)
Successfully installed activerecord-4.0.0
Fetching: mime-types-1.25.gem (100%)
Successfully installed mime-types-1.25
Fetching: polyglot-0.3.3.gem (100%)
Successfully installed polyglot-0.3.3
Fetching: treetop-1.4.15.gem (100%)
Successfully installed treetop-1.4.15
Fetching: mail-2.5.4.gem (100%)
Successfully installed mail-2.5.4
Fetching: actionmailer-4.0.0.gem (100%)
Successfully installed actionmailer-4.0.0
Fetching: thor-0.18.1.gem (100%)
Successfully installed thor-0.18.1
Fetching: railties-4.0.0.gem (100%)
Successfully installed railties-4.0.0
Fetching: hike-1.2.3.gem (100%)
Successfully installed hike-1.2.3
Fetching: tilt-1.4.1.gem (100%)
Successfully installed tilt-1.4.1
Fetching: sprockets-2.10.0.gem (100%)
Successfully installed sprockets-2.10.0
Fetching: sprockets-rails-2.0.1.gem (100%)
Successfully installed sprockets-rails-2.0.1
Fetching: rails-4.0.0.gem (100%)
Successfully installed rails-4.0.0
Installing ri documentation for actionmailer-4.0.0
Installing ri documentation for actionpack-4.0.0
Installing ri documentation for activemodel-4.0.0
Installing ri documentation for activerecord-4.0.0
Installing ri documentation for activerecord-deprecated_finders-1.0.3
Installing ri documentation for activesupport-4.0.0
Installing ri documentation for arel-4.0.1
Installing ri documentation for atomic-1.1.14
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for test/performance.rb, skipping
Installing ri documentation for builder-3.1.4
Installing ri documentation for erubis-2.7.0
Installing ri documentation for hike-1.2.3
Installing ri documentation for i18n-0.6.5
Installing ri documentation for mail-2.5.4
Installing ri documentation for mime-types-1.25
Installing ri documentation for minitest-4.7.5
Installing ri documentation for multi_json-1.8.2
Installing ri documentation for polyglot-0.3.3
unable to convert "\x89" from ASCII-8BIT to UTF-8 for test/multipart/binary, skipping
Installing ri documentation for rack-1.5.2
Installing ri documentation for rack-test-0.6.2
Installing ri documentation for rails-4.0.0
Installing ri documentation for railties-4.0.0
Installing ri documentation for sprockets-2.10.0
Installing ri documentation for sprockets-rails-2.0.1
Installing ri documentation for thor-0.18.1
Installing ri documentation for thread_safe-0.1.3
Installing ri documentation for tilt-1.4.1
Installing ri documentation for treetop-1.4.15
Installing ri documentation for tzinfo-0.3.38
28 gems installed
なんか、ASCII-8BIT から UTF-8 の変換ができんとかいってるけど、無視かな。
~$ rails -v
Rails 4.0.0
おっと、今だと4.0.0がインストールされるのか。
<終了>
と、ここまで20分程度。すごく簡単に完了。依存関係とかで結構はまった経験があるのだが、rvmからの手順だとあったりなのね。それともubuntuだからなのか?
先々は、apache + passengaerで動かそうと思ってる。rvmだと個人の環境にインストールされるが、システムへのインストールとかもできるのかなとおもって調べたら、rootで入れれば/usr/local/rvmにインストールされるのね。便利ねぇ。