Webistranoのインストール
WebistranoはCapistranoのWebフロントエンドで
ブラウザからCapistranoを実行できます。
主にこののような使い方ができます。
以下にインストールからブラウザでアクセスするまでを記載します。
Webistranoダウンロード
// git から clone git clone git://github.com/peritor/webistrano.git // 設定ファイル cd webistrano rbenv local 1.8.7-p374 cp -p config/webistrano_config.rb.sample config/webistrano_config.rb cp -p config/database.yml.sample config/database.yml vi config/database.yml ================== database, username, password, socket を適宜修正 ================== // 特定のページでエラーになるので、deployer.rbを一部修正 vi lib/webistrano/deployer.rb ================== # 25行目 # if(@deployment.task && !@deployment.new_record?) if(!@deployment[:task].nil? && !@deployment.new_record?) ==================
Gemfileを修正
vi Gemfile ================== #gem "rake" gem "rake", "0.8.7" ==================
※最新のrakeだとrakeコマンドが動作しない。dbのmigrateでこけました・・・
gem で各種インストール
gem install bundler -v 1.0.10 bundle install --path vendor/bundler
DB のマイグレーション
// database追加 create database webistrano_development; create database webistrano_test; create database webistrano_production; // maigrate RAILS_ENV=development bundle exec rake db:migrate RAILS_ENV=test bundle exec rake db:migrate RAILS_ENV=production bundle exec rake db:migrate
webistrano 起動
ruby script/server -p 3000 -e production
iptableで3000番ポートを開放してあげて、下記URLをブラウザからアクセス
http://[hostname or ipaddr]:3000