- レーキ 0.8.7
- レール 2.3.18
- RubyGems 1.7.2
同様の質問を調べましたが、ここには当てはまりません。
- タスクで再帰を行わない
- Bundler または RVM を使用していない (Bundler を使用することが解決策である場合、私はうんざりです)
- ActionView::ヘルパーを含まない
- scrubyt という名前の gem を使用しない
- トランザクションを使用するようにコードを変更しても、問題は修正されません。
ブレインデッドの単純な行の更新。移行またはシードとして実行しても同じ結果になります。
class AddValuesForPlanApiQuotaDaily < ActiveRecord::Migration
def self.up
p = Plan.find(10)
p.api_quota_daily = 3000
p.save!
end
end
または db/seeds.rb から:
p = Plan.find(10)
if p.api_quota_daily.nil?
p.api_quota_daily = 3000
p.save!
end
結果:
$ rake db:seed --trace
** Invoke db:seed (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:seed
rake aborted!
stack level too deep
痕跡:
/home/fun/dev/company/project/vendor/plugins/deadlock_retry/lib/deadlock_retry.rb:45:in `transaction_without_deadlock_handling'
/home/fun/dev/company/project/vendor/plugins/deadlock_retry/lib/deadlock_retry.rb:45:in `transaction'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/transactions.rb:200:in `save!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.18/lib/active_record/transactions.rb:200:in `save!'
/home/fun/dev/company/project/db/seeds.rb:8
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
/usr/lib/ruby/gems/1.8/gems/rails-2.3.18/lib/tasks/databases.rake:211
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
このプロジェクトの rake をアップグレードしたり、バンドラーの使用を開始したりできません。