Search code examples
rubyrubygemsjrubyrufus-scheduler

No such file to load -- rufus-scheduler


I'am developing a plugin in redmine how send mail every days , so i install rufus-scheduler and in my Gemfile i add this line

gem "rufus-scheduler "

and also i install the gem

sudo gem install rufus-scheduler --source http://gemcutter.org

and in my redmine/plugins/latest-issues-redmine-plugin/lib/latest_issues/view_hook_listener.rb i do this

class LatestIssuesViewHookListener < Redmine::Hook::ViewListener

    require File.join(File.dirname(__FILE__), '../../app/models/latest_issues_setup')
    require 'net/smtp'
    require 'rubygems'
    require 'rufus-scheduler

def load_issues   
 scheduler = Rufus::Scheduler.start_new   
 scheduler.every '1h' do
send_email "[email protected]", :body => html
  end
end
end        

Any ideas for this error ?

Thanks


Solution

  • sudo gem install rufus-scheduler --source http://gemcutter.org
    

    installs rubygems via the "gem" command, which, usually, points to the "system" Ruby which is, usually again, not JRuby.

    You could probably do

    jruby -S gem install rufus-scheduler
    

    to install the gem in the JRuby load path.