Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4.2 #24

Closed
AlexBaturin opened this issue Mar 25, 2015 · 1 comment
Closed

Rails 4.2 #24

AlexBaturin opened this issue Mar 25, 2015 · 1 comment

Comments

@AlexBaturin
Copy link

Hello! Can you help me make work, elasticsearch in redmine, with rails 4.2?
I got some error:

[root@locarmine upd_redmine]# bundle exec rake redmine_elasticsearch:reindex_all RAILS_ENV=production --trace
Loading Rails environment for Resque
** Invoke redmine_elasticsearch:reindex_all (first_time)
** Invoke redmine_elasticsearch:logged (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine_elasticsearch:logged
** Execute redmine_elasticsearch:reindex_all
Recreate index for all available search types
rake aborted!
NoMethodError: undefined method scoped' for #<Class:0x0000000500f820> /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-4.2.0/lib/active_record/dynamic_matchers.rb:26:inmethod_missing'
/var/www/upd_redmine/plugins/redmine_elasticsearch/app/models/parent_project.rb:57:in searching_scope' /var/www/upd_redmine/plugins/redmine_elasticsearch/lib/redmine_elasticsearch/indexer_service.rb:45:infor_each_parent_project'
/var/www/upd_redmine/plugins/redmine_elasticsearch/lib/redmine_elasticsearch/indexer_service.rb:18:in reindex_all' /var/www/upd_redmine/plugins/redmine_elasticsearch/lib/tasks/index.rake:18:inblock (2 levels) in <top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in call' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:inblock in execute'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in each' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:inexecute'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in block in invoke_with_call_chain' /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:inmon_synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in invoke_with_call_chain' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:ininvoke'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:150:in invoke_task' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:inblock (2 levels) in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in each' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:inblock in top_level'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:115:in run_with_threads' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:100:intop_level'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:78:in block in run' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:176:instandard_exception_handling'
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:75:in run' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/bin/rake:33:in<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p551/bin/rake:23:in load' /usr/local/rvm/gems/ruby-1.9.3-p551/bin/rake:23:in

'
/usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in eval' /usr/local/rvm/gems/ruby-1.9.3-p551/bin/ruby_executable_hooks:15:in'
Tasks: TOP => redmine_elasticsearch:reindex_all

@gc-olivierho
Copy link

I got the same issue (since Redmine switched to Rails 4 with its 3.0 version), and found that if you modify line 57 of app/models/parent_project.rb
from
self.scoped
to
self.all
it fixes the issue.
Please refer (for example) to rails/rails#12756 indicating that .scoped is deprecated in Rails 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants