s21gブログを動かしているEC2インスタンスのRailsを 2.1.1にバージョンアップしました。
Rails 2.1.1: Lots of bug fixes
Rails 2.1.1 is another maintenanc
e release that includes a bunch of bug fixes and a fix for the REXML vulnerabil ity. I’ve extracted all the changes from the CHANGELOGs into a single Gist. Enjoy!
以下、バージョンアップに関する作業ログです。
まずは
trident
を立ち上げると以下のようなWARNINGが。
DEPRECATIO
N WARNING: Dependenci es is deprecated ! Use ActiveSupp ort::Depen dencies instead. See http://www .rubyonrai ls.org/dep recation for details. (called from evaluate_i nit_rb at blog/vendo r/plugins/ background _fu/init.r b:1)
とりあえず最新版のBackground
config/env
1 config.gem 'ncr-background_fu', 2 :lib => 'background _fu', 3 :source => 'http://gem s.github.c om'
そして
1 % sudo rake gems:install
そして不要になったプラグインを削除。
1 % ./script/plugin remove background _fu 2 svn: '/home/taki uchi/blog/ vendor/plu gins' is not a working copy
おっと。script/plu
はまだGitには対応してないのかな?
しかし警告メッセージは出ましたが、当該ディレクトリはきちんと削除されていた模様。
もう一度trident
を立ち上げるが、また同様の警告が出た。
ということで、background
config/env
1 config.gem 'genki-background_fu', 2 :lib => 'background _fu', 3 :source => 'http://gem s.github.c om'
これで警告は出なくなった。
rake -T
は特に問題なく実行できる。
rake test
を実行。
DEPRECATIO
N WARNING: follow_red irect is deprecated and will be removed from Rails 2.2 (If you wish to follow redirects, you should use integratio n tests) See http://www .rubyonrai ls.org/dep recation for details. (called from test_clean ing_up_bla nk_page at ./test/fun ctional/ar ticles_con troller_te st.rb:305)
とのこと。follow_red
を使いたい場合は
インテグレーションテストを使ってね、ということらしい。
いわれてみればその通りですね。
これを機にIntegratio
とりあえず、該当箇所をIntegratioscript/gen
コマンドがUpdateされてる可能性があったので、
rake rails:upda
を実行してみたが、config/boo
が数行変わっただけであった。どうやらRubyGemsの最低要求バージョンが1.1.1
以降となった模様。
Integratiofollow_red
ではなく、follow_red
を使う必要があった。
と、ここまででテストでのWARNINGもすべて解消。
あとはローカル環境で動作テストをした後に、
cap shell
で必要なGemをインストールしてcap deploy
WARNINGを消すためにひと手間かかりましたが、 基本的には特に大きな修正も必要なくアップグレードできました。