`rake paperclip:refresh class=Photo` is no longer working - ruby-on-rails

This used to work alright. Now I am getting this error:
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
** Invoke paperclip:refresh (first_time)
** Invoke paperclip:refresh:metadata (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute paperclip:refresh:metadata
rake aborted!
Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id
/Users/macuser/Sites/hq_channel/app/models/media.rb:23:in `touch_organization'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:251:in `create_or_update'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/base.rb:2551:in `save_without_validation!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/validations.rb:1019:in `save_without_dirty!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/timestamp.rb:37:in `touch'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:221:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:221:in `method_missing'
/Users/macuser/Sites/hq_channel/app/models/gallery.rb:16:in `touch_media'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:251:in `create_or_update'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/base.rb:2551:in `save_without_validation!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/validations.rb:1019:in `save_without_dirty!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/timestamp.rb:37:in `touch'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:221:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:221:in `method_missing'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/associations.rb:1348:in `belongs_to_touch_after_save_or_destroy_for_gallery'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:178:in `evaluate_method'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:166:in `call'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/Users/macuser/Sites/hq_channel/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/callbacks.rb:251:in `create_or_update'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/base.rb:2534:in `save_without_validation'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/validations.rb:1009:in `save_without_dirty'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in `save_without_transactions'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `send'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/Users/macuser/Sites/hq_channel/vendor/rails/activerecord/lib/active_record/transactions.rb:196:in `save'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:59
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:26:in `for_all_attachments'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:24:in `each'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:24:in `for_all_attachments'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:22:in `each'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:22:in `for_all_attachments'
/Users/macuser/Sites/hq_channel/lib/tasks/paperclip_tasks.rake:54
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:205:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:205:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:200:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:200:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:158:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:176:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:174:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:174:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:157:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/task.rb:144:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:112:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:90:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:90:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:84:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:62:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.9.0/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Tasks: TOP => paperclip:refresh => paperclip:refresh:metadata
Can anyone make heads or tails of what is happening here and how I can fix it?

Try rake paperclip:refresh class=Photo (notice the uppercase P)?

Related

foreman 1.7 error message I18n::InvalidLocale: :en is not a valid locale

I'm a newbie in ruby.Today I install foreman from source.
When I run command RAILS_ENV=production bundle exec rake db:seed assets:precompile locale:pack, it generates the following error message.
I don't think there is something wrong with the code, because I get the code
from git with command git clone https://github.com/theforeman/foreman.git -b 1.7-stable
After I get the error message,I do the following things: edit file ROOTDIR/config/application.rb, add the following lines, but it also get the same error message
config.i18n.enforce_available_locales = false
config.i18n.available_locales = ["zh-CN"]
#config.i18n.default_locales = :'zh-CN'
My ruby verision is ruby-2.0.0-p451
Looking forward to anyone get me out of the fall. Thanks.
########## error message ############
rake aborted!
I18n::InvalidLocale: :en is not a valid locale
/root/foreman/vendor/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n.rb:284:in `enforce_available_locales!'
/root/foreman/vendor/ruby/2.0.0/gems/i18n-0.7.0/lib/i18n.rb:151:in `translate'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/naming.rb:57:in `human'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/errors.rb:346:in `generate_message'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/errors.rb:359:in `normalize_message'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/errors.rb:234:in `add'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations/inclusion.rb:19:in `validate_each'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validator.rb:153:in `block in validate'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validator.rb:150:in `each'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validator.rb:150:in `validate'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:310:in `_callback_before_105'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:550:in `_run__2320509037395656532__validate__260782132788772307__callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validate_callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations.rb:228:in `run_validations!'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `block in run_validations!'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:425:in `_run__2320509037395656532__validation__260782132788772307__callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
/root/foreman/vendor/ruby/2.0.0/gems/activemodel-3.2.21/lib/active_model/validations.rb:195:in `valid?'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/validations.rb:69:in `valid?'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/validations.rb:77:in `perform_validations'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/validations.rb:50:in `save'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:22:in `save'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:in `block in save'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:258:in `save'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/persistence.rb:217:in `block in update_attributes'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/persistence.rb:215:in `update_attributes'
/root/foreman/app/models/setting.rb:177:in `block in create_existing'
/root/foreman/app/models/setting.rb:184:in `bypass_readonly'
/root/foreman/app/models/setting.rb:174:in `create_existing'
/root/foreman/app/models/setting.rb:167:in `create!'
/root/foreman/app/models/setting/general.rb:29:in `block (2 levels) in load_defaults'
/root/foreman/app/models/setting/general.rb:29:in `each'
/root/foreman/app/models/setting/general.rb:29:in `block in load_defaults'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/root/foreman/app/models/setting/general.rb:13:in `load_defaults'
/root/foreman/config/initializers/foreman.rb:20:in `each'
/root/foreman/config/initializers/foreman.rb:20:in `<top (required)>'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `load'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `block in load'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:245:in `load'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/engine.rb:592:in `each'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/engine.rb:592:in `block in <class:Engine>'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `instance_exec'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/initializable.rb:30:in `run'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/initializable.rb:55:in `block in run_initializers'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `each'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/initializable.rb:54:in `run_initializers'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/application.rb:136:in `initialize!'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'
/root/foreman/config/environment.rb:5:in `<top (required)>'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `block in require'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:236:in `load_dependency'
/root/foreman/vendor/ruby/2.0.0/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/application.rb:103:in `require_environment!'
/root/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/root/foreman/vendor/ruby/2.0.0/gems/activerecord-3.2.21/lib/active_record/railties/databases.rake:346:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:abort_if_pending_migrations => environment
change
config.i18n.available_locales = ["zh-CN"]
to
config.i18n.available_locales = ["zh-CN",:en]

Rails Executing migration ArgumentError

I'm having a strange problem executing rake db:migrate
== 20141127213559 CreateMovies: migrating =====================================
-- create_table(:movies)
-> 0.0033s
== 20141127213559 CreateMovies: migrated (0.0034s) ============================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (1 for 0)
ArgumentError: wrong number of arguments (1 for 0)
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
What I did was:
rails generate model Movie
And then edit the migration CreateMovies
class CreateMovies < ActiveRecord::Migration
def up
#drop_table :movies
create_table :movies do |t|
t.string :title
t.string :rating
t.text :description
t.datetime :release_date
# Add fields that let Rails automatically keep track
# of when movies are added or modified:
t.timestamps
end
end
def down
drop_table :movies
end
end
This is the output of executing the command with --trace
[fran#arch rottenpotatoes]$ rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20141127213559 CreateMovies: migrating =====================================
-- create_table(:movies)
-> 0.0039s
== 20141127213559 CreateMovies: migrated (0.0041s) ============================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (1 for 0)/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `initialize'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `new'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `substitute_at'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:97:in `block in substitute_values'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each_with_index'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `substitute_values'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:56:in `insert'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:521:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/counter_cache.rb:139:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_methods/dirty.rb:122:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:306:in `block in _create_record'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `call'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:734:in `_run_create_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:306:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/timestamp.rb:57:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:501:in `create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `call'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:734:in `_run_save_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:302:in `create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:142:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/validations.rb:42:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:289:in `block in save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:345:in `block in with_transaction_returning_status'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:342:in `with_transaction_returning_status'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:289:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:51:in `create!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1015:in `record_version_state_after_migrating'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:985:in `block in execute_migration_in_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `block in ddl_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `ddl_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:983:in `execute_migration_in_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:945:in `block in migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `each'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:813:in `up'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:791:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:240:in `call'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:240:in `block in execute'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:235:in `each'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:235:in `execute'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:165:in `invoke'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:156:in `invoke_task'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `each'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `block in top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:121:in `run_with_threads'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:106:in `top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:84:in `block in run'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:182:in `standard_exception_handling'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:79:in `run'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/bin/rake:33:in `<top (required)>'
/home/fran/.gem/ruby/2.1.0/bin/rake:23:in `load'
/home/fran/.gem/ruby/2.1.0/bin/rake:23:in `<main>'
ArgumentError: wrong number of arguments (1 for 0)
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `initialize'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `new'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `substitute_at'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:97:in `block in substitute_values'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each_with_index'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `substitute_values'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:56:in `insert'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:521:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/counter_cache.rb:139:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_methods/dirty.rb:122:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:306:in `block in _create_record'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `call'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:734:in `_run_create_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:306:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/timestamp.rb:57:in `_create_record'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:501:in `create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `call'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activesupport-4.2.0.beta4/lib/active_support/callbacks.rb:734:in `_run_save_callbacks'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/callbacks.rb:302:in `create_or_update'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:142:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/validations.rb:42:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:289:in `block in save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:345:in `block in with_transaction_returning_status'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:342:in `with_transaction_returning_status'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:289:in `save!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/persistence.rb:51:in `create!'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1015:in `record_version_state_after_migrating'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:985:in `block in execute_migration_in_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `block in ddl_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/transactions.rb:218:in `transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:1030:in `ddl_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:983:in `execute_migration_in_transaction'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:945:in `block in migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `each'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:941:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:813:in `up'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/migration.rb:791:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/usr/lib/ruby/gems/2.1.0/gems/activerecord-4.2.0.beta4/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:240:in `call'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:240:in `block in execute'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:235:in `each'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:235:in `execute'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/task.rb:165:in `invoke'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:156:in `invoke_task'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `block (2 levels) in top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `each'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:112:in `block in top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:121:in `run_with_threads'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:106:in `top_level'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:84:in `block in run'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:182:in `standard_exception_handling'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/lib/rake/application.rb:79:in `run'
/usr/lib/ruby/gems/2.1.0/gems/rake-10.4.0/bin/rake:33:in `<top (required)>'
/home/fran/.gem/ruby/2.1.0/bin/rake:23:in `load'
/home/fran/.gem/ruby/2.1.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate
Any help would be really appreciated. Thanks.
If you are using Rails 4.2.0.beta4, ActiveRecord will require arel gem. Add the following to your gem file
gem 'arel', '6.0.0.beta2'
and run
bundle install
You may get below error message
You have requested:arel = 6.0.0.beta2
The bundle currently has arel locked at 6.0.0.
Try running `bundle update arel`
then
bundle update arel
Now you should able to run migration.
Here you may find similar and explanatory answer: Can't migrate database after scaffold. Section 2.2 Ruby on Rails Tutorial Michael Hartl
Maybe you should execute this after create movies table:
generate migration AddFieldsToMovies newfield:type
This generates the correct migration, see this:
http://edgeguides.rubyonrails.org/active_record_migrations.html#changing-tables

Rails validation error: Account can not be blank

I am receiving the following error when running my rake task:
Validation failed: Account can't be blank
This is the bit of code throwing the error:
test.entries.create!({
:account_id => account.id,
:date => date
})
My validation for both test and entries only validates the presence of :account_id. I know the error message is humanized to remove the .id, but it is obvious that :account_id exists. What am I missing here? I am using rails 3.1.14.
EDIT:
The full trace error is below-
rake aborted!
Validation failed: Account can't be blank
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/validations.rb:56:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:264:in `block in save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:208:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:264:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/has_many_through_association.rb:85:in `save_through_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/has_many_through_association.rb:52:in `insert_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:348:in `block in save_collection_association'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:341:in `each'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:341:in `save_collection_association'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:191:in `block in add_autosave_association_callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:161:in `instance_eval'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/autosave_association.rb:161:in `block in define_non_cyclic_method'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:413:in `_run__3251750978270077373__create__1709181034843668520__callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/callbacks.rb:268:in `create'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/persistence.rb:348:in `create_or_update'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/callbacks.rb:264:in `block in create_or_update'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:447:in `_run__3251750978270077373__save__1709181034843668520__callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/callbacks.rb:264:in `create_or_update'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/persistence.rb:104:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/validations.rb:56:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:264:in `block in save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:208:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:264:in `save!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/has_many_association.rb:14:in `insert_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:436:in `block (2 levels) in create_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:344:in `add_to_target'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:434:in `block in create_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:149:in `block in transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/transactions.rb:208:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:148:in `transaction'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:433:in `create_record'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_association.rb:123:in `create!'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/activerecord-3.2.14/lib/active_record/associations/collection_proxy.rb:46:in `create!'
/Users/Luigi/Desktop/Projects/test/lib/tasks/createnew.rake:179:in `block (5 levels) in <top (required)>'
/Users/Luigi/Desktop/Projects/test/lib/tasks/createnew.rake:165:in `each'
/Users/Luigi/Desktop/Projects/test/lib/tasks/createnew.rake:165:in `block (4 levels) in <top (required)>'
/Users/Luigi/Desktop/Projects/test/lib/tasks/createnew.rake:90:in `upto'
/Users/Luigi/Desktop/Projects/test/lib/tasks/createnew.rake:90:in `block (3 levels) in <top (required)>'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/Luigi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/Luigi/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/bin/rake:19:in `load'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/bin/rake:19:in `<main>'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/bin/ruby_noexec_wrapper:14:in `eval'
/Users/Luigi/.rvm/gems/ruby-1.9.3-p429#test/bin/ruby_noexec_wrapper:14:in `<main>'
The particular line of code mentioned above is on line 179, and it is inside a loop that starts on line 165, which is inside a loop that starts on line 90.
Try to add the following in your model:
attr_accessible :account
or
attr_accessible :account_id
depending on your needs.
test.entries.create!(account_id: account.id)
is the same as (assuming there is a "relation"):
test.entries.create!(account: account)

Google-maps-for-Rails - undefined method `gmaps' for (object) in rake task

When I run a rake task that involves a model with gmaps4rails enabled I get this error, and if I comment the model so it's not acts_as_gmappable it completes properly.
enter code here
troy$ rake populate:scans --trace
** Invoke populate:scans (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute populate:scans
http://goo.gl/fb/977ze
Sat, 16 Jul 2011 19:43:59 GMT
47.676506
-122.121872
91df0f32209c5212XXXXXXXXXXXXXXX
rake aborted!
undefined method `gmaps' for #<Scan:0x000001051fb9a8>
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.9/lib/active_model/attribute_methods.rb:392:in `method_missing'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/attribute_methods.rb:46:in `method_missing'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/gmaps4rails-0.9.1/lib/gmaps4rails/acts_as_gmappable.rb:12:in `process_geocoding'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:415:in `_run_validate_callbacks'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.9/lib/active_model/validations.rb:212:in `run_validations!'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.9/lib/active_model/validations/callbacks.rb:67:in `block in run_validations!'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:414:in `_run_validation_callbacks'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.9/lib/active_model/validations/callbacks.rb:67:in `run_validations!'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activemodel-3.0.9/lib/active_model/validations.rb:179:in `valid?'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/validations.rb:55:in `valid?'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/validations.rb:75:in `perform_validations'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/validations.rb:43:in `save'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/attribute_methods/dirty.rb:21:in `save'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:240:in `block (2 levels) in save'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:292:in `block in with_transaction_returning_status'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/connection_adapters/abstract/database_statements.rb:139:in `transaction'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:207:in `transaction'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:290:in `with_transaction_returning_status'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:240:in `block in save'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:251:in `rollback_active_record_state!'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/activerecord-3.0.9/lib/active_record/transactions.rb:239:in `save'
/Users/troy/Documents/projects/qrbrowser/lib/tasks/populate.rake:42:in `block (3 levels) in <top (required)>'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:239:in `block in each'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:238:in `upto'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/nokogiri-1.5.0/lib/nokogiri/xml/node_set.rb:238:in `each'
/Users/troy/Documents/projects/qrbrowser/lib/tasks/populate.rake:23:in `block (2 levels) in <top (required)>'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:205:in `block in execute'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:200:in `each'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:200:in `execute'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/troy/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/task.rb:144:in `invoke'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `each'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:90:in `block in top_level'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:84:in `top_level'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/application.rb:59:in `run'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/bin/rake:32:in `<top (required)>'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `load'
/Users/troy/.rvm/gems/ruby-1.9.2-p180/bin/rake:19:in `<main>'
Tasks: TOP => populate:scans
Solution 1:
acts_as_gmappable :process_geocoding => false
Solution 2:
When you're creating an instance of your model, do:
#scan.instance_eval do
def process_geocoding
true
end
end

wrong number of arguments (1 for 0) has_many_association.rb:61

I am upgrading my app from Rails 2.2 to 2.3.5 and I am seeing the following error while using '<<' for saving a has_many relationship.
Eg: Breaks test
ev = UserEvent.new
# model specific code here
self.user_events << ev
Eg: Works
ev = UserEvent.new
# model specific code here
ev.user_id = self.id
ev.save!
This worked fine with Rails 2.2.
The issue that I see is similar to http://www.ruby-forum.com/topic/188598 (How can I track if a plugin or gem is causing this issue)
Full error log:
wrong number of arguments (1 for 0)
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:61:in `save'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:61:in `insert_record'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:145:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:145:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:298:in `save_collection_association'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'
/home/rails/.cruise/projects/rails235/work/vendor/plugins/will_paginate/lib/will_paginate/finder.rb:167:in `method_missing'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:289:in `save_collection_association'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/autosave_association.rb:168:in `autosave_associated_records_for_user_events'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `instance_eval'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:180:in `evaluate_method'
/home/rails/.cruise/projects/rails235/work/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:554:in `call'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:93:in `run'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:92:in `run'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activesupport/lib/active_support/callbacks.rb:276:in `run_callbacks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:344:in `callback'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:267:in `create'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/base.rb:2874:in `create_or_update_without_callbacks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/callbacks.rb:250:in `create_or_update'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/base.rb:2555:in `save_without_validation!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/validations.rb:1088:in `save_without_dirty!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/dirty.rb:87:in `save_without_transactions!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:182:in `transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/transactions.rb:200:in `save!'
./db/migrate//294_add_system_user.rb:43:in `up_without_benchmarks'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `send'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/opt/ruby-enterprise/lib/ruby/1.8/benchmark.rb:293:in `measure'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:282:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `__send__'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:365:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:486:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:562:in `call'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:562:in `ddl_transaction'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:485:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:472:in `each'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:472:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:400:in `up'
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/migration.rb:383:in `migrate'
/home/rails/.cruise/projects/rails235/work/vendor/rails/railties/lib/tasks/databases.rake:116
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/home/rails/.cruise/projects/rails235/work/lib/tasks/cruisecontrol.rake:23
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/opt/cruisecontrolrb-1.3.0/tasks/cc_build.rake:5:in `invoke_rake_task'
/opt/cruisecontrolrb-1.3.0/tasks/cc_build.rake:35
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `call'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:636:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:631:in `execute'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:597:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:590:in `invoke_with_call_chain'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:583:in `invoke'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2047:in `invoke_task'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `each'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2025:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2019:in `top_level'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1997:in `run'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:2064:in `standard_exception_handling'
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/rake-0.8.6/lib/rake.rb:1994:in `run'
-e:1
Any help is tracking this down is really appreciated :)
I don't see anything wrong from your code, but in the error it looks like you're using a pagination plugin which may be your culprit.
/home/rails/.cruise/projects/rails235/work/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:369:in `method_missing_without_paginate'

Resources