ArgumentError: invalid date when run minitest through jenkins execute shell - ruby

I can run minitest through terminal command, but when I run the same command through jenkins, it throws "ArgumentError: invalid date" on all my test cases. I can't find any solutions from Google. Anyone can help me? And is here the right place to ask these questions?
ruby ../udesk_devops/autotest.rb 'develop' 'daily'
This can run correct through command line.
But will through 'invalid date' through jenkins
And in the process of executing through jenkins, I can see rollback in the log.
It seems the data is trying to go into mysql from fixtures.
Error:
test_问题库分类列表(管理员的问题库)(OpenApiV1::KnowledgeCatalogsControllerTest):
ArgumentError: invalid date
/usr/share/rvm/gems/ruby-2.3.3/gems/timecop-0.8.1/lib/timecop/time_extensions.rb:108:in `parse'
/usr/share/rvm/gems/ruby-2.3.3/gems/timecop-0.8.1/lib/timecop/time_extensions.rb:108:in `parse_with_mock_date'
/usr/share/rvm/gems/ruby-2.3.3/gems/activesupport-4.0.13/lib/active_support/core_ext/string/conversions.rb:53:in `to_datetime'
/usr/share/rvm/gems/ruby-2.3.3/gems/activesupport-4.0.13/lib/active_support/core_ext/date_time/calculations.rb:164:in `<=>'
/usr/share/rvm/gems/ruby-2.3.3/gems/activesupport-4.0.13/lib/active_support/core_ext/time/calculations.rb:286:in `compare_with_coercion'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:570:in `=='
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:570:in `block (2 levels) in table_rows'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:569:in `each'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:569:in `block in table_rows'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:557:in `each'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:557:in `map'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:557:in `table_rows'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:473:in `block (3 levels) in create_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:471:in `each'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:471:in `block (2 levels) in create_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract/database_statements.rb:203:in `block in transaction'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `within_new_transaction'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract/database_statements.rb:203:in `transaction'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:470:in `block in create_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:274:in `disable_referential_integrity'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:457:in `create_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:899:in `load_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:859:in `setup_fixtures'
/usr/share/rvm/gems/ruby-2.3.3/gems/activerecord-4.0.13/lib/active_record/fixtures.rb:712:in `before_setup'
/var/lib/jenkins/workspace/udesk_proj_week_daily/test/test_helper.rb:35:in `before_setup'

Related

Vagrant throws error when executing 'vagrant up'

Earlier today my Homestead was working fine and using 'vagrant up' didn't cause any problems. I tried starting it a few minutes ago and I got this error:
C:/Users/Robin/embedded/mingw64/lib/ruby/2.4.0/json/common.rb:156:in `parse': 751: unexpected token at '' (JSON::ParserError)
from C:/Users/Robin/embedded/mingw64/lib/ruby/2.4.0/json/common.rb:156:in `parse'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/vagrantfile.rb:181:in `machine_config'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/vagrantfile.rb:45:in `machine'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:719:in `machine'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/plugin/v2/command.rb:180:in `block in with_target_vms'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/plugin/v2/command.rb:213:in `block in with_target_vms'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/plugin/v2/command.rb:212:in `map'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/plugin/v2/command.rb:212:in `with_target_vms'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/plugins/commands/destroy/command.rb:45:in `block in execute'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:280:in `block (2 levels) in batch'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:278:in `tap'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:278:in `block in batch'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:277:in `synchronize'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:277:in `batch'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/plugins/commands/destroy/command.rb:44:in `execute'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/cli.rb:54:in `execute'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/lib/vagrant/environment.rb:294:in `cli'
from C:/Users/Robin/embedded/gems/2.1.4/gems/vagrant-2.1.4/bin/vagrant:164:in `<main>'
I've looked the error up but all I can find is people telling there is a extra space or enter in the 'Homestead.yaml' file which is not the case.

Capistrano 3 deployment is broken

my capistrano3 deployment is broken. I really don't know why, it was like yesterday it works and today it doesn't. Please have a look at the error it gives me:
cap aborted!
Errno::ENOENT: No such file or directory # rb_file_s_stat - /tmp/PROJECT-0d9226685f71.tar.gz
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:117:in `stat'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:117:in `set_current'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp/upload.rb:24:in `upload_start_state'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:324:in `call'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:324:in `process'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `block in preprocess'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `each'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:223:in `preprocess'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:206:in `process'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `block in loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/session.rb:170:in `loop'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-ssh-3.0.2/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:34:in `block in upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:141:in `with_ssh'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:33:in `upload!'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/capistrano-scm-gitcopy-0.1.2/lib/capistrano/tasks/gitcopy.rake:79:in `block (4 levels) in <top (required)>'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:64:in `within'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/capistrano-scm-gitcopy-0.1.2/lib/capistrano/tasks/gitcopy.rake:77:in `block (3 levels) in <top (required)>'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `instance_exec'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `run'
/Users/USER/.rvm/gems/ruby-2.2.0#SERVER/gems/sshkit-1.8.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => gitcopy:create_release
The deploy has failed with an error: No such file or directory # rb_file_s_stat - /tmp/PROJECT-0d9226685f71.tar.gz
** Invoke deploy:failed (first_time)
** Execute deploy:failed
I don't know what it is. Maybe some capistrano bug or a bug in my configs? Let me know if you need more informations
Answer is following:
https://github.com/xuwupeng2000/capsitrano-scm-gitcopy#installation
Finally, DO NOT ADD require 'capistrano/gitcopy' to Capfile because capistrano/setup already loads the scm module with the :scm value you specified.

Test suite before upgrade to rails 4.2 from rails 3.2

I recently tried to updated my Rails app from Rails 3.2 to Rails 4.2. Before the upgrade all my test suite runs perfectly, but after the update I'm getting something strange. every time i tried to run a test the same error happens
rake db:fixtures:load --trace
** Invoke db:fixtures:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:fixtures:load
rake aborted!
NameError: uninitialized constant ActiveRecord::FixtureSet::RenderContext::MassiveMessage
(erb):11:in `get_binding'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `eval'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/erb.rb:863:in `result'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:42:in `render'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:33:in `rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:24:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:758:in `block (2 levels) in read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixture_set/file.rb:15:in `open'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:757:in `block in read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `each_with_object'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:756:in `read_fixture_files'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:592:in `initialize'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:514:in `new'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:514:in `block (2 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:511:in `map'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:511:in `block in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:282:in `disable_referential_integrity'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:508:in `create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:203:in `block (3 levels) in '
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/alexander/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/alexander/.rvm/rubies/ruby-2.2.0/bin/rake:33:in `'
Can anyone help me with this?
After deleting that Fixtures i get another error see
rake aborted!
TypeError: no implicit conversion of Fixnum into String
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:636:in `gsub'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:636:in `block (2 levels) in table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:635:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:635:in `block in table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `map'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:623:in `table_rows'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:526:in `block (3 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:524:in `each'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:524:in `block (2 levels) in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:523:in `block in create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:282:in `disable_referential_integrity'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/fixtures.rb:508:in `create_fixtures'
/home/alexander/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:203:in `block (3 levels) in '
Tasks: TOP => db:fixtures:load
(See full trace by running task with --trace)
:(
I did a progressive updatefrom rails 3.2 to 4.02, then from 4.02 to 4.1, all worked smoothly, then at rails 4.2 i got the same error
i posted the issue at github in rails repositories and they answer me that it's a bug and will be released at version 4.2.1
for the moment you can correct this doing this.
row[key] = value.gsub("$LABEL", label.to_s) if value.is_a?(String)
at line 636 of the file fixture.rb from activerecord library

"vagrant up" fails, and error is "invalid byte sequence in Windows-31J (ArgumentError)"

This is the error. Please, does anyone know a solution?
sansontakeshi-no-MacBook-Air:~ yama1223xxx$ vagrant up
/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:127:in `downcase': invalid byte sequence in Windows-31J (ArgumentError)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:127:in `block (2 levels) in fs_real_path'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:126:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:126:in `block in fs_real_path'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:125:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/platform.rb:125:in `fs_real_path'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:118:in `initialize'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:157:in `new'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:157:in `<main>'
Per this page, consider setting your locale to ja_JP.UTF-8:
$ export LANG=ja_JP.UTF-8

How to fix ActiveRecord::DangerousAttributeError when checking pending migration in RSpec spec_helper?

Okay so this is a new one. RSPec. Rails 4.
This line is in my spec_helper.rb:
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
When I run a simple test (on an ActiveRecord model):
it { should respond_to :activity }
I get the following error & trace:
/Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord 4.0.0/lib/active_record/attribute_methods.rb:59:in `instance_method_already_implemented?': version is defined by Active Record (ActiveRecord::DangerousAttributeError)
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:282:in `block in define_attribute_method'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:279:in `each'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:279:in `define_attribute_method'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `block in define_attribute_methods'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `each'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activemodel-4.0.0/lib/active_model/attribute_methods.rb:246:in `define_attribute_methods'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:29:in `block in define_attribute_methods'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:26:in `synchronize'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:26:in `define_attribute_methods'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/attribute_methods.rb:167:in `respond_to?'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:368:in `__define_callbacks'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activesupport-4.0.0/lib/active_support/callbacks.rb:79:in `run_callbacks'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/core.rb:216:in `init_with'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/persistence.rb:55:in `instantiate'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/querying.rb:45:in `block in find_by_sql'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/result.rb:21:in `block in each'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/result.rb:21:in `each'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/result.rb:21:in `each'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/querying.rb:45:in `map'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/querying.rb:45:in `find_by_sql'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/relation.rb:585:in `exec_queries'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/relation.rb:471:in `load'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/relation.rb:220:in `to_a'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/relation/delegation.rb:12:in `map'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/migration.rb:787:in `get_all_versions'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/migration.rb:793:in `current_version'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/migration.rb:800:in `needs_migration?'
from /Users/dev/.rvm/gems/ruby-2.0.0-p247#projectname/gems/activerecord-4.0.0/lib/active_record/migration.rb:379:in `check_pending!'
from /projects/subset_of_projects/this_project_group/projectname/spec/spec_helper.rb:17:in `<top (required)>'
I'd added the paper_trail gem but not run the install/migrations. Simple and obvious really. But it wasn't an error I'd seen before so I'll post this so others who might run into it can check the obvious before wasting a long time on this.

Resources