Ruby on Railes の開発環境を整える
移転しました。
Rubyインストール
# yum install ruby ruby-devel rdoc
Rubygemsインストール
$ wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz $ tar zxvf rubygems-0.9.4.tgz $ cd rubygems-0.9.4 $ su # ruby setup.rb
Ruby on Rails インストール
# gem install rails 動作確認のため以下を実行。WEBサーバーが起動 # ruby test/script/server
その後ブラウザでhttp://localhost:3000 のようにアクセス。
WEBサーバーのトップ画面を表示する。
MySQLのインストール
RDBMS にはMySQLを使用するため、こちらをインストール
# yum install mysql mysql-server mysql-devel # emacs /etc/my.cnf ----- 以下を[mysqld],[mysql],[mysqldump]の最後に追加 default-character-set=utf8 ----- MySQL起動 # /sbin/service mysqld start 自動起動設定 # /sbin/chkconfig mysqld on パスワード設定 # mysqladmin -u root password "hoge" MySQL/Rubyアダプタのインストール # gem install mysql -- --with-mysql-config=/usr/bin/mysql_config Bulk updating Gem source index for: http://gems.rubyforge.org Select which gem to install for your platform (i386-linux) 1. mysql 2.7.3 (mswin32) 2. mysql 2.7.1 (mswin32) 3. mysql 2.7 (ruby) 4. mysql 2.6 (ruby) 5. Skip this gem 6. Cancel installation > 3 Building native extensions. This could take a while... Successfully installed mysql-2.7