Project

General

Profile

rake aborted! NoMethodError: undefined method `safe_attributes'

Added by Abdullah-Al Roman about 6 years ago

I am getting "rake aborted!" error while try to install one plugin(event_notifications). Any help will be highly appreciated... I have done below procedures to install the plugin:

1. copy the plugin directory to plugin/

2. run the following commands into the redmine server:
• a. $ cd /jet/app/redmine/bin
• b. $ bundle install
• c. $ rake db:migrate RAILS_ENV=production got the below warning
Your Gemfile lists the gem redmine_extensions (>= 0) more than once. You should probably keep only one of them. While it's not a problem now, it could cause errors if you change the version of just one of them later.
• d. $ rake redmine:plugins:migrate RAILS_ENV=production
below is the details:
Environment:
Redmine version 3.3.2.stable
Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux]
Rails version 4.2.7.1
Environment production
Database adapter PostgreSQL
SCM:
Subversion 1.9.4
Git 2.9.2

Bundle complete! 35 Gemfile dependencies, 57 gems now installed.
Gems in the groups development and test were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
jet@localhost:~/app/redmine/bin$ rake redmine:plugins:migrate RAILS_ENV=production
(in /jet/app/redmine)
rake aborted!
NoMethodError: undefined method `safe_attributes' for #<Class:0x00000004117430>
/jet/var/ruby/gems/vendor/gems/activerecord-4.2.7.1/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/jet/app/redmine/plugins/event_notifications-master/lib/event_notification/patches/user_preference_patch.rb:11:in `block in included'
/jet/app/redmine/plugins/event_notifications-master/lib/event_notification/patches/user_preference_patch.rb:9:in `class_eval'
/jet/app/redmine/plugins/event_notifications-master/lib/event_notification/patches/user_preference_patch.rb:9:in `included'
/jet/app/redmine/plugins/event_notifications-master/lib/event_notification/patches/user_preference_patch.rb:54:in `include'
/jet/app/redmine/plugins/event_notifications-master/lib/event_notification/patches/user_preference_patch.rb:54:in `<top (required)>'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/app/redmine/plugins/event_notifications-master/init.rb:15:in `<top (required)>'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/app/redmine/lib/redmine/plugin.rb:155:in `block in load'
/jet/app/redmine/lib/redmine/plugin.rb:146:in `each'
/jet/app/redmine/lib/redmine/plugin.rb:146:in `load'
/jet/app/redmine/config/initializers/30-redmine.rb:21:in `<top (required)>'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `block in load'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:268:in `load'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:166:in `instrument'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/engine.rb:651:in `load_config_initializer'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `each'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `instance_exec'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:30:in `run'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `each'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/initializable.rb:54:in `run_initializers'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/application.rb:352:in `initialize!'
/jet/app/redmine/config/environment.rb:14:in `<top (required)>'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/jet/var/ruby/gems/vendor/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/application.rb:328:in `require_environment!'
/jet/var/ruby/gems/vendor/gems/railties-4.2.7.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/jet/var/ruby/gems/vendor/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)

Replies (1)

RE: rake aborted! NoMethodError: undefined method `safe_attributes' - Added by Michael Leahcim over 5 years ago

Hi,

a few hours ago, i had just the same problem an i solved it. Try this:

- Use the Redmine Release 3.4.6
- copy the Plugin folder into redmine plugin directory and delete "-master" in the Foldername. At the end the name of the plugin folder has to be "event_notifications" not "event_notification-master"

I hope it helps!?

    (1-1/1)