s21gブログを動かしているEC2インスタンスのRailsを
2.1.1にバージョンアップしました。

Rails 2.1.1: Lots of bug fixes

Rails 2.1.1 is another maintenance release that includes a bunch of bug fixes and a fix for the REXML vulnerability. I’ve extracted all the changes from the CHANGELOGs into a single Gist. Enjoy!

以下、バージョンアップに関する作業ログです。
まずは
trident
を立ち上げると以下のようなWARNINGが。

DEPRECATION WARNING: Dependencies is deprecated! Use ActiveSupport::Dependencies instead. See http://www.rubyonrails.org/deprecation for details. (called from evaluate_init_rb at blog/vendor/plugins/background_fu/init.rb:1)

とりあえず最新版のBackgroundFu
をあたってみます。
いつの間にかGemPluginになってる。よしよし。

config/environment.rbに以下を追記。

rails>>
config.gem 'ncr-background_fu',
:lib => 'background_fu',
:source => 'http://gems.github.com'
<<--

そして

sh>>
% sudo rake gems:install
<<--

そして不要になったプラグインを削除。

pre>>
% ./script/plugin remove background_fu
svn: '/home/takiuchi/blog/vendor/plugins' is not a working copy
<<--

おっと。script/plugin removeはまだGitには対応してないのかな?
しかし警告メッセージは出ましたが、当該ディレクトリはきちんと削除されていた模様。
もう一度tridentを立ち上げるが、また同様の警告が出た。
ということで、background_fuを
forkすることにした

config/environment.rbを書き直す。

rails>>
config.gem 'genki-background_fu',
:lib => 'background_fu',
:source => 'http://gems.github.com'
<<--

これで警告は出なくなった。
rake -Tは特に問題なく実行できる。
rake testを実行。

DEPRECATION WARNING: follow_redirect is deprecated and will be removed from Rails 2.2 (If you wish to follow redirects, you should use integration tests) See http://www.rubyonrails.org/deprecation for details. (called from test_cleaning_up_blank_page at ./test/functional/articles_controller_test.rb:305)

とのこと。follow_redirectを使いたい場合は
インテグレーションテストを使ってね、ということらしい。
いわれてみればその通りですね。
これを機にIntegrationTest周りのサポートが充実すると嬉しい。

とりあえず、該当箇所をIntegrationTestに切り出すことに。
その前にscript/generateコマンドがUpdateされてる可能性があったので、
rake rails:updateを実行してみたが、config/boot.rbが数行変わっただけであった。どうやらRubyGemsの最低要求バージョンが1.1.1以降となった模様。

IntegrationTestでは、follow_redirectではなく、follow_redirect!
を使う必要があった。
と、ここまででテストでのWARNINGもすべて解消。

あとはローカル環境で動作テストをした後に、
cap shellで必要なGemをインストールしてcap deploy

WARNINGを消すためにひと手間かかりましたが、
基本的には特に大きな修正も必要なくアップグレードできました。

posted by genki genki on Sun 7 Sep 2008 at 02:18 with 0 comments
Contents rssrss
光ファイバーを二次元振動させて走査するAR用ディスプレイ
因果の取り違え
Swift2's defer for CoffeeScript
mongodb-3.0からcreateIndexのdropDupsが無くなったらしい
mongodb-3.0以降のWiredTigerの設定を動的に変更する方法
一般楕円の高速生成アルゴリズムへの道標
farro mantecatoのレシピ
Droonga関連の記事のまとめ
RuntimeErrorの特定のメッセージに限定してrescueする方法
jQueryでscriptタグを実行せずにappendする
Tags
coffeescriptdefergroongajsmemonodenodejs
Comments rssrss
瀧内元気 瀧内元気: MacOS版は以下にあります genki/ViMouse 01/16 05:40
dsjf dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これでも出... 01/08 23:23
瀧内元気 瀧内元気: おお、チェックしてみます。thx! 12/24 05:23
overisland overisland: Reeder for iPhone もこの UI を実装していますね。 12/24 05:13
瀧内元気 瀧内元気: その情報は見たのですが、以下のサイトによると、現在はまた必要になってるっぽいんですよね。 http:... 12/01 12:20
tkawa tkawa: http://devcenter.heroku.com/articles/rails31_herok... 12/01 10:47
瀧内元気 瀧内元気: どもー。いまはgithubに置いてあります https://github.com/genki/irb... 07/10 08:31
ともち ともち: こんにちは! すばらしいプログラムをありがとうございます。しかし、merbiのドメイン、切れているみ... 07/10 02:30
Services from s21g
YOMU Web小説リーダー
Web小説を音声で楽しむ読み上げリーダー
補助探
公開されている補助金・助成金情報を集約し、条件に合う制度を探しやすくするサービスです。
jotter.me
個人開発者のためのホスティング一体型ノートサービス
ハンドミラー
iPhone向けの手鏡アプリ
ツイプロ(twpro)
Twitterプロフィールの高速検索エンジン