07
Dec

しばらく開発をさぼってる間にDreamHostのCapistranoのバージョンアップしていた模様。正しくデプロイできないようになってたので対処メモ。

まずこれまでは、RailsアプリケーションのデプロイにCapistranoを利用していたので、開発環境から変更をコミットした後、本番環境(DreamHost)にて以下のコマンドを打つだけでデプロイが完了していました。

CODE:
  1. $ cd (該当Railsアプリケーション用ディレクトリ)
  2. $ svn update
  3. $ rake deploy

しかし先日、これまで通りデプロイを実行すると以下のエラーが。

rake aborted!
RubyGem version error: net-ssh(1.0.8 not >= 2.0.0)

なのでまずは、net-sshをはじめとして関連するgemの最新バージョンをインストールします。
※ユーザ環境にgemをインストールする設定はすでに完了しているものとします(cf. Ruby on Rails - DreamHost > Using Gems Installed in Your Home Directory)

CODE:
  1. $ gem install net-ssh
  2. $ gem install net-sftp
  3. $ gem install net-scp
  4. $ gem install net-ssh-gateway
  5. $ gem install highline

続いて新バージョンのCapistranoで初期化みたいな作業 "capify" をします。Capistrano: Upgrade Guideによるとこんな意味があるそうです。

First, you need to "capify" your project, since Capistrano 2.0 no longer recognizes "config/deploy.rb" automatically. (See the sidebar on the right for more information.)
(中略)
It will automatically create a "Capfile" for you, and (if the config directory exists, and config/deploy.rb does not) it will also create a skeletal "config/deploy.rb" file, too.

CODE:
  1. $ cd (該当Railsアプリケーション用ディレクトリ)
  2. $ capify .
  3. [add] writing `./Capfile'
  4. [skip] `./config/deploy.rb' already exists
  5. [done] capified!

そして最後に実行( "rake deploy" はもう使わないらしい)。

CODE:
  1. $ cap deploy

無事にデプロイできました。

14
Oct

spamに蹂躙されまくって一時サービスを停止していた「○○ベスト3」にAkismetを導入し、復旧しました。

参考サイト

  1. »soaked & soaped« – How To Protect A Rails Application Against Spam with Akismet
  2. Akismet を導入してみる - happy lie, happy life. » Diary