• 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

TAG_rel_2-0-0_RC2をfreezeしたプロジェクトでDBを作成しようとしたところ、下記のエラーが。

shell-unix-generic>>
$ sudo rake db:create RAILS_ENV='production'
(in /usr/local/foo)
rake aborted!
undefined method `whiny_protected_attributes=' for ActiveRecord::Base:Class

(See full trace by running task with --trace)
<<--

同じことを言っている人がrubyonrails.comのコメントにもいて、ちゃんとJeremy Kemperが返事を書いています。
http://documentation.rubyonrails.com/2007/11/9/rails-2-0-release-candidate-1#comment-17936

delete the whiny_protected_attributes setting from your environement. It was in the preview release but is not in the release candidate, so if you generated an app with the preview and are now upgrading it, you’ll need to remove that line.

というわけでconfig/environments/production.rb内で下記をコメントアウトしました。

shell-unix-generic>>

Disable raising errors when mass-assigning to a protected attribute

config.active_record.whiny_protected_attributes = false

<<--

すんなり解決。

posted by satoko satoko on Mon 3 Dec 2007 at 11:32 with 0 comments