Rails3のインストール
Rails2.3とRuby1.8.7が入っているところにRails3.1とRuby1.9.3を入れる
Ruby1.9.3
- http://rubyinstaller.org/downloads/ からDL
- C:\Ruby193にインストールする。C:\Ruby187はそのまま
- Rails3.1を入れる為に環境変数のPATHを変更する
C:\Users\kenmituo>ruby -v ruby 1.9.3p194 (2012-04-20) [i386-mingw32]
Rails3.1
gemで指定バージョンを入れる
gem install rails -v 3.1.8
エラーになる
DevKit
- Development Kitを http://rubyinstaller.org/downloads/ からDL
- C:\Ruby193\DevKitに展開
C:\Ruby193\DevKit>ruby dk.rb init [INFO] found RubyInstaller v1.8.7 at C:/Ruby187 [INFO] found RubyInstaller v1.9.3 at C:/Ruby193 Initialization complete! Please review and modify the auto-generated 'config.yml' file to ensure it contains the root directories to all of the installed Rubies you want enhanced by the DevKit.
- C:\Ruby193\DevKit\config.ymlを編集
#- C:/Ruby187 - C:/Ruby193
- インストール
C:\Ruby193\DevKit>ruby dk.rb install [INFO] Updating convenience notice gem override for 'C:/Ruby193' [INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'
Rails2.3で作成したプロジェクトに追加
aptanaのターミナルを開く
hoge > bundle install
--- Installing json (1.7.4) with native extensions Installing rdoc (3.12) Using thor (0.14.6) Installing railties (3.1.3) Installing coffee-rails (3.1.1) Installing jquery-rails (1.0.19) Installing mail-iso-2022-jp (1.2.0) Installing mysql2 (0.3.11) Installing rails (3.1.3) Installing rails3-jquery-autocomplete (1.0.7) Installing sass (3.2.0) Installing sass-rails (3.1.6) Installing uglifier (1.2.7) Installing will_paginate (3.0.3)
mysql2
- gem install mysql2
libmysql.dll
c:\workspace\support>rails s C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2. rb:2:in `require': Incorrect MySQL client library version! This gem was compiled for 6.0.0 but the client library is 5.5.16. (RuntimeError)
エラーがでた
- http://dev.mysql.com/downloads/connector/c/からバージョンにあわせたライブラリ(mysql-connector-c-6.0.2-win32.msi)をインストール
- C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2\libopt\libmysql.dll を C:\Ruby19\binへコピー
Gemfile
BundlerというRubyGems管理ツールでgemファイルを管理しているらしい。
# SQLite3ではなくMySQLを使う # gem 'sqlite3' gem "mysql2", "~> 0.3.11" # Will Paginateを使う gem 'will_paginate', '~> 3.0'
plugin
error_messages_for
プラグインの名前とgitの名前が異なるの?
rails plugin install git://github.com/rails/dynamic_form.git
auto_complete
長くなりそうなのであとで