インストールで嵌ったのでメモ。
結論からいうと
rails2.1でActiveScaffoldを入れるには
[script/plugin instal]でなく
gitで古いバージョンを取得してやる必要がある。
やり方は
$ git clone git://github.com/activescaffold/active_scaffold.git Initialized empty Git repository in /hogehoge/vendor/plugins/active_scaffold/.git/ remote: Counting objects: 5559, done. remote: Compressing objects: 100% (1578/1578), done. remote: Total 5559 (delta 4093), reused 5023 (delta 3704) Receiving objects: 100% (5559/5559), 741.86 KiB | 309 KiB/s, done. Resolving deltas: 100% (4093/4093), done. $ cd active_scaffold/ $ git tag 1.0.0 1.0.1 1.1.0 1.1.1 1.2RC1 $ git checkout 1.2RC1 Note: moving to "1.2RC1" which isn't a local branch If you want to create a new branch from this checkout, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -bHEAD is now at de5d28a... Updated changelog for release 1.2RC1
ここから下は悩んだ履歴
ActiveScaffoldは、svn版(http://activescaffold.googlecode.com/svn/tags/)と
git版(http://activescaffold.com/)がweb上には存在してんだけど
rails2.1 over に対応しているのは、git版。
最初知らなくて、svn版をインストールして
使ってみたところ
/opt/local/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/core_ext/module/aliasing.rb:31:in `alias_method': undefined method `find_full_template_path' for class `ActionView::Base' (NameError)
エラー。
それならば、git版をということで試してみると
/hogehoge/vendor/plugins/active_scaffold/init.rb:5:in `evaluate_init_rb': This version of ActiveScaffold requires Rails 2.2 or higher. Please use an earlier version. (RuntimeError)
ん?rails2.2以上なの?
でも、gettextを使ってみる - うんたらかんたらRuby - Rubyist
で入れたgettextが2.2に対応してないから2.1対応してる古いバージョンないかなぁと
webをよくみたら↓みたいにversion指定できるみたいなので
script/plugin install git://github.com/activescaffold/active_scaffold.git -r rails-2.2
「rails-2.2」を「rails-2.1」に変えてinstallしてみるも
同じエラー。
どうやら、script/pluginのバージョン指定はrails2.2以降らしい。
ということで、頭のgitを実行して解決。