Project

General

Profile

db:migrate error from redmine 2.6.0 to 3.2.5

Added by Richard Meston almost 8 years ago

RAILS_ENV=production bin/about

sh: svn: command not found
sh: darcs: command not found
sh: hg: command not found
sh: cvs: command not found
sh: bzr: command not found
sh: git: command not found
Environment:
Redmine version 3.2.5.stable
Ruby version 1.9.3-p547 (2014-05-14) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter Mysql2
SCM:
Filesystem
Redmine plugins:
no plugin installed

./bin/bundle install --without development test rmagick
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this
machine.
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.1
Using minitest 5.5.0
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.2.7.1
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0.rc2
Using nokogiri 1.6.7.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.5
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.7.1
Using rack 1.6.0
Using rack-test 0.6.2
Using actionpack 4.2.7.1
Using globalid 0.3.0
Using activejob 4.2.7.1
Using mime-types 2.99
Using mail 2.6.4
Using actionmailer 4.2.7.1
Using actionpack-action_caching 1.0.0
Using actionpack-xml_parser 1.0.2
Using activemodel 4.2.7.1
Using arel 6.0.0
Using activerecord 4.2.7.1
Using addressable 2.4.0
Using coderay 1.1.0
Using css_parser 1.3.4
Using hike 1.2.3
Using htmlentities 4.3.1
Using thor 0.19.1
Using railties 4.2.7.1
Using jquery-rails 3.1.4
Using mimemagic 0.1.1
Using multi_json 1.10.1
Using mysql2 0.3.17
Using net-ldap 0.12.0
Using protected_attributes 1.0.0
Using ruby-openid 2.3.0
Using rack-openid 1.4.2
Using bundler 1.6.2
Using tilt 1.4.1
Using sprockets 2.12.3
Using sprockets-rails 2.2.2
Using rails 4.2.7.1
Using rbpdf-font 1.19.0
Using rbpdf 1.19.0
Using redcarpet 3.3.2
Using request_store 1.0.5
Using roadie 3.1.0
Using roadie-rails 1.1.1
Your bundle is complete!
Gems in the groups development, test and rmagick were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Hi

I am getting the following error when attempting to run the following command as root to migrate from redmine 2.6.0 to 3.2.5
./bin/bundle exec rake db:migrate RAILS_ENV=production --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
20141029181752 AddTrackersDefaultStatusId: migrating =====================
-- add_column(:trackers, :default_status_id, :integer)
-> 0.0248s
20141029181752 AddTrackersDefaultStatusId: migrated (0.1289s) ============

q:qrake aborted!
StandardError: An error has occurred, all later migrations canceled:

undefined method `initialize_attributes' for ActiveRecord::SchemaMigration(version: string):Class/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/protected_attributes-1.0.0/lib/active_record/mass_assignment_security/core.rb:8:in `initialize'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/inheritance.rb:61:in `new'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/inheritance.rb:61:in `new'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/protected_attributes-1.0.0/lib/active_record/mass_assignment_security/validations.rb:15:in `create!'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1029:in `record_version_state_after_migrating'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:999:in `block in execute_migration_in_transaction'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:1046:in `ddl_transaction'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:997:in `execute_migration_in_transaction'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:959:in `block in migrate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:955:in `migrate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:823:in `up'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/migration.rb:801:in `migrate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/opt/chef/embedded/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate

Thanks

Rich


Replies (1)

RE: db:migrate error from redmine 2.6.0 to 3.2.5 - Added by Richard Meston almost 8 years ago

Resolved - Used protected attributes protected_attributes-1.1.3 rather than protected_attributes-1.0.0

    (1-1/1)