SSブログ

Ruby1.9+Rails3の導入 [Ruby on Rails]

Windows環境で、Ruby1.9+Rails3の導入。
Windowsは7。

1.Ruby 1.9.2インストール
導入に使うファイル:
  ruby-1.9.2-p136-i386-mswin32.zip
  readline-4.3-2-mswin32.zip
  zlib-1.1.4-1-mswin32.zip
  openssl-0.9.8q-win32-bin_dynamic.zip
  iconv-1.8.win32.zip

(1)ruby-1.9.2-p136-i386-mswin32.zipの展開

(2)環境変数PATHへRubyのbinフォルダを追加
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\bin;

(3)Rubyの動作確認
  C:\Ruby>ruby -v
  ruby 1.9.2p136 (2010-12-25 revision 30365) [i386-mswin32]

(4)readlinesの導入
  ①readline-4.3-2-mswin32.zipの展開
  ②bin配下のファイルをRubyのbinフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\bin
  ③lib配下のファイルをRubyのlibフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\lib

  ※readlinesを導入していないとirbの実行でエラーが出る

(5)irbの動作確認
  C:\Ruby>irb -v
  irb 0.9.6(09/06/30)

  C:\Ruby>irb
  irb(main):001:0> print "hello"
  hello=> nil
  irb(main):002:0> exit

  C:\Ruby>

  ※readlinesを導入していないとエラーが出る

(6)zlibの導入
  ①zlib-1.1.4-1-mswin32.zipの展開
  ②bin配下のファイルをRubyのbinフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\bin
  ③lib配下のファイルをRubyのlibフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\lib

(7)opensslの導入
  ①openssl-0.9.8q-win32-bin_dynamic.zipの展開
  ②libeay32.dllとssleay32.dllをRubyのbinフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\bin
  ③lib配下のファイルをRubyのlibフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\lib

(8)iconvの導入
  ①iconv-1.8.win32.zipの展開
  ②lib配下のiconv.dllをRubyのbinフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\bin
  ③lib配下のlibファイルをRubyのlibフォルダへ移動
  <展開先ドライブ>:<展開先フォルダ>\ruby-1.9.2-p136-i386-mswin32\lib

(9)gemの動作確認
  C:\Ruby>gem -v
  1.3.7

  C:\Ruby>gem list --local

  *** LOCAL GEMS ***

  minitest (1.6.0)
  rake (0.8.7)
  rdoc (2.5.8)

  C:\Ruby>gem list --remote rails

  *** REMOTE GEMS ***
  rails (3.0.9)
  rails-3-settings (0.1.1)
  :
  :
  C:\Ruby>

(10)gemの更新と確認
  gem(RubyGems)を1.3.7から1.8.7に更新する

  C:\Ruby>gem update --system
  Updating RubyGems
  Updating rubygems-update
  Successfully installed rubygems-update-1.8.7
  Updating RubyGems to 1.8.7
  Installing RubyGems 1.8.7
  RubyGems 1.8.7 installed

  == 1.8.7 / 2011-08-02

  * 5 bug fixes:
   * Added missing require for `gem uninstall --format-executable`
   * The correct name of the executable being uninstalled is now displayed with
   --format-executable
   * Fixed `gem unpack uninstalled_gem` default version picker
   * RubyGems no longer claims a nonexistent gem can be uninstalled
   * `gem which` no longer claims directories are requirable files
   * `gem cleanup` continues cleaning up gems if one can't be uninstalled due
   to permissions. Issue #82
   * Gem repository directories are no longer created world-writable. Patch by
   Sakuro OZAWA. Ruby Bug #4930
  
  ------------------------------------------------------------------------------

  RubyGems installed the following executables:
   C:/Ruby/ruby-1.9.2-p136-i386-mswin32/bin/gem

  C:\Ruby>
  C:\Ruby>gem -v
  1.8.7

  C:\Ruby>

(11)インストールフォルダのバックアップ
  <展開先ドライブ>:<展開先フォルダ>をコピー
  ※フォルダ名:ruby-1.9.2-p136-i386-mswin32(Initial)

2.SQLiteインストール
SQLite(sqlite3)はRailsのデフォルトDB
導入に使うファイル:
  sqlite-dll-win32-x86-3070400.zip
  sqlite-shell-win32-x86-3070400.zip

(1)展開先フォルダの作成
  <Program Files配下のSQLite展開先フォルダ>

(2)sqlite3ライブラリの導入
  ①sqlite-dll-win32-x86-3070400.zipの展開
  ②配下のファイルをSQLite展開先フォルダへ移動

(3)sqlite3コマンドの導入
  ①sqlite-shell-win32-x86-3070400.zipの展開
  ②配下のファイルをSQLite展開先フォルダへ移動

(4)環境変数PATHへSQLite展開先フォルダを追加
  C:\Program Files\<SQLite展開先フォルダ>;

(5)Rubyのsqlite3プラグインの導入
  C:\Ruby>gem install sqlite3
  Fetching: sqlite3-1.3.4-x86-mswin32-60.gem (100%)
  Successfully installed sqlite3-1.3.4-x86-mswin32-60
  1 gem installed
  Installing ri documentation for sqlite3-1.3.4-x86-mswin32-60...
  Installing RDoc documentation for sqlite3-1.3.4-x86-mswin32-60...

  C:\Ruby>

3.Rails3のインストール
Rails3は3.0.9(2011/8時の最新)を使用

(1)Rails3の導入
  C:\Ruby>gem install rails -v 3.0.9 -p http://proxy.css.fujitsu.com:8080

  Fetching: activesupport-3.0.9.gem (100%)

  Fetching: builder-2.1.2.gem (100%)

  WARNING: builder-2.1.2 has an invalid nil value for @cert_chain

  Fetching: i18n-0.5.0.gem (100%)

  Fetching: activemodel-3.0.9.gem (100%)

  Fetching: rack-1.2.3.gem (100%)

  Fetching: rack-test-0.5.7.gem (100%)

  Fetching: rack-mount-0.6.14.gem (100%)

  Fetching: tzinfo-0.3.29.gem (100%)

  Fetching: abstract-1.0.0.gem (100%)

  WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain

  Fetching: erubis-2.6.6.gem (100%)

  Fetching: actionpack-3.0.9.gem (100%)

  Fetching: arel-2.0.10.gem (100%)

  Fetching: activerecord-3.0.9.gem (100%)

  Fetching: activeresource-3.0.9.gem (100%)

  Fetching: mime-types-1.16.gem (100%)

  Fetching: polyglot-0.3.2.gem (100%)

  Fetching: treetop-1.4.10.gem (100%)

  Fetching: mail-2.2.19.gem (100%)

  Fetching: actionmailer-3.0.9.gem (100%)

  Fetching: thor-0.14.6.gem (100%)

  Fetching: rdoc-3.9.1.gem (100%)

  Depending on your version of ruby, you may need to install ruby rdoc/ri data:

  

  <= 1.8.6 : unsupported

   = 1.8.7 : gem install rdoc-data; rdoc-data --install

   = 1.9.1 : gem install rdoc-data; rdoc-data --install

  >= 1.9.2 : nothing to do! Yay!

  Fetching: railties-3.0.9.gem (100%)

  Fetching: bundler-1.0.17.gem (100%)

  Fetching: rails-3.0.9.gem (100%)

  Successfully installed activesupport-3.0.9

  Successfully installed builder-2.1.2

  Successfully installed i18n-0.5.0

  Successfully installed activemodel-3.0.9

  Successfully installed rack-1.2.3

  Successfully installed rack-test-0.5.7

  Successfully installed rack-mount-0.6.14

  Successfully installed tzinfo-0.3.29

  Successfully installed abstract-1.0.0

  Successfully installed erubis-2.6.6

  Successfully installed actionpack-3.0.9

  Successfully installed arel-2.0.10

  Successfully installed activerecord-3.0.9

  Successfully installed activeresource-3.0.9

  Successfully installed mime-types-1.16

  Successfully installed polyglot-0.3.2

  Successfully installed treetop-1.4.10

  Successfully installed mail-2.2.19

  Successfully installed actionmailer-3.0.9

  Successfully installed thor-0.14.6

  Successfully installed rdoc-3.9.1

  Successfully installed railties-3.0.9

  Successfully installed bundler-1.0.17

  Successfully installed rails-3.0.9

  24 gems installed

  Installing ri documentation for activesupport-3.0.9...

  unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for lib/active_support/core_ext/string/conversions.rb, skipping

  unable to convert U+00C6 from UTF-8 to Windows-31J for lib/active_support/inflector/transliterate.rb, skipping

  unable to convert U+00E9 from UTF-8 to Windows-31J for lib/active_support/multibyte/chars.rb, skipping

  Installing ri documentation for builder-2.1.2...

  Installing ri documentation for i18n-0.5.0...

  unable to convert U+00C0 from UTF-8 to Windows-31J for lib/i18n/backend/transliterator.rb, skipping

unable to convert U+00E4 from UTF-8 to Windows-31J for lib/i18n/tests/interpolation.rb, skipping

  unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for lib/i18n.rb, skipping

  Installing ri documentation for activemodel-3.0.9...

  Installing ri documentation for rack-1.2.3...

  Installing ri documentation for rack-test-0.5.7...

  Installing ri documentation for rack-mount-0.6.14...

  Installing ri documentation for tzinfo-0.3.29...

  Installing ri documentation for abstract-1.0.0...

  Installing ri documentation for erubis-2.6.6...

  Installing ri documentation for actionpack-3.0.9...

  Installing ri documentation for arel-2.0.10...

  Installing ri documentation for activerecord-3.0.9...

  ERROR: While generating documentation for activerecord-3.0.9

  ... MESSAGE: Invalid argument - ./

※ドキュメントの導入でエラーが出たが無視。

(2)gemの確認
  C:\Ruby>gem list -l

  *** LOCAL GEMS ***

  abstract (1.0.0)

  actionmailer (3.0.9)

  actionpack (3.0.9)

  activemodel (3.0.9)

  activerecord (3.0.9)

  activeresource (3.0.9)

  activesupport (3.0.9)

  arel (2.0.10)

  builder (2.1.2)

  bundler (1.0.17)

  erubis (2.6.6)

  i18n (0.5.0)

  mail (2.2.19)

  mime-types (1.16)

  minitest (1.6.0 ruby)

  polyglot (0.3.2)

  rack (1.2.3)

  rack-mount (0.6.14)

  rack-test (0.5.7)

  rails (3.0.9)

  railties (3.0.9)

  rake (0.8.7 ruby)

  rdoc (3.9.1, 2.5.8 ruby)

  rubygems-update (1.8.7)

  sqlite3 (1.3.4 x86-mswin32-60)

  thor (0.14.6)

  treetop (1.4.10)

  tzinfo (0.3.29)

  

  C:\Ruby>

  



(3)Rails3のバージョン確認



  C:\Ruby>rails -v

  Rails 3.0.9

  

  C:\Ruby>



(4)インストールフォルダのバックアップ

  <展開先ドライブ>:<展開先フォルダ>をコピー

  ※フォルダ名:ruby-1.9.2-p136-i386-mswin32(+Rails)



(5)その他のプラグイン導入



  will_paginate 3.0.0

  web-app-theme 0.7.0



  ※とりあえず最新を導入



  C:\Ruby>gem install will_paginate -v 3.0.0

  Fetching: will_paginate-3.0.0.gem (100%)

  Successfully installed will_paginate-3.0.0

  1 gem installed

  Installing ri documentation for will_paginate-3.0.0...

  unable to convert "\xC4" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for LICENSE, skipping

  Installing RDoc documentation for will_paginate-3.0.0...

  unable to convert "\xC4" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to Windows-31J for LICENSE, skipping



  C:\Ruby>gem install web-app-theme -v 0.7.0 -p http://proxy.css.fujitsu.com:8080

  Fetching: web-app-theme-0.7.0.gem (100%)

  Successfully installed web-app-theme-0.7.0

  1 gem installed

  Installing ri documentation for web-app-theme-0.7.0...

  Installing RDoc documentation for web-app-theme-0.7.0...

  

  C:\Ruby>



(6)インストールフォルダのバックアップ

  <展開先ドライブ>:<展開先フォルダ>をコピー

  ※フォルダ名:ruby-1.9.2-p136-i386-mswin32(+R+Etc)



以上。


nice!(0) 

nice! 0

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。