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に以下を追記。

   1    config.gem 'ncr-background_fu',
   2      :lib => 'background_fu',
   3      :source => 'http://gems.github.com'

そして

   1  % sudo rake gems:install

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

   1  % ./script/plugin remove background_fu
   2  svn: '/home/takiuchi/blog/vendor/plugins' is not a working copy

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

config/environment.rbを書き直す。

   1    config.gem 'genki-background_fu',
   2      :lib => 'background_fu',
   3      :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 Png genki on Sun 7 Sep 2008 at 01:58

Search Words:

  • rails65 2.1.216 update14 アップデート14 2.1.111 2.17 2.26 rake6 activesupport::dependencies3 follow_redirect3 use3 warning3 is3 deprecated3 migrate3 バージョンアップ2 bug2 deprecation2 dependencies2 test2 instead2 mac2 background_fu2 cache2 redirect1 時間1 from1 be1 deprecated!1 autotest1 インストール1 session1 gem1 warnning1 ./script/plugin1 プラグイン1 消す1 removed1 redmine1 if you wish to follow redirects, you should use integration tests1 remove1 function1 follow1 コマンド1 インテグレーションテスト1 ruby1 rubygems1 boot.rb1 config1 raisl1 検索1 2.1.1rake1 on1 ubuntu1 generate1 最新版1 instead.1 and1 script1 svn1 upgrade1 patch1 アップグレード1 warning:1 will1

Comments:

or Preview
Tags
rails blog memo 211
Social Bookmarks
  • Delicious
  • B_entry865
  • Clip_16_12_w865