Ruby1.8.7 + Rails2 安裝流程
1. 安裝Ruby
下載地址:(https://rubyinstaller.org/downloads/archives/)
https://dl.bintray.com/oneclick/rubyinstaller/ruby-1.8.7-p302-i386-mingw32.7z
2. 安裝rake
gem install rake -v 0.8.3
3. 安裝rails
gem install rails -v 2.3.10
與MySQL進行連接
1. 安裝 activerecord-mysql2-adapter
gem install activerecord-mysql2-adapter
2. 建立 : config/initializers/abstract_mysql2_adapter.rb
內容如下:
require 'active_record/connection_adapters/mysql2_adapter'
class ActiveRecord::ConnectionAdapters::Mysql2Adapter
NATIVE_DATABASE_TYPES[:primary_key] = "int(11) auto_increment PRIMARY KEY"
end
3. database.yml
development:
adapter: mysql2
encoding: utf8
database: rordb
username: root
password: admin
pool: 5
timeout: 5000
相關鏈結:
Ruby 1.8.7 p302
https://www.ruby-lang.org/en/news/2010/08/16/ruby-1-8-7-p302-is-released/
Rails 2.3.10
https://rubygems.org/gems/rails/versions/2.3.10
rake 0.8.3
https://rubygems.org/gems/rake/versions/0.8.3
Mysql2-adapter
https://rubygems.org/gems/activerecord-mysql2-adapter/versions/0.0.3