Question

I am building a plugin for Redmine 2.0 and for the following line in plugin's 'init.rb'

require 'ice_cube'

I get the load error even though the 'ice_cube' is installed and show up when I do 'gem list' I am using rvm with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

Here is the error log:

/Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- ice_cube (LoadError)
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/plugins/redmine_asset_tracker/init.rb:2:in `<top (required)>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in `require'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/lib/redmine/plugin.rb:129:in `block in load'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/lib/redmine/plugin.rb:120:in `each'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/lib/redmine/plugin.rb:120:in `load'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config/initializers/30-redmine.rb:13:in `<top (required)>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `block in load'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/engine.rb:587:in `each'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/engine.rb:587:in `block in <class:Engine>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/initializable.rb:30:in `run'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/initializable.rb:55:in `block in run_initializers'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `each'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/application.rb:136:in `initialize!'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config/environment.rb:14:in `<top (required)>'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config.ru:4:in `require'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config.ru:4:in `block in <main>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config.ru:1:in `new'
    from /Users/myth/Learn/Code/Berkman GSOC 2012/Berkman/redmine/config.ru:1:in `<main>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/builder.rb:40:in `eval'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/builder.rb:40:in `parse_file'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:200:in `app'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/commands/server.rb:46:in `app'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/server.rb:252:in `start'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in `start'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/commands.rb:55:in `block in <top (required)>'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `tap'
    from /Users/myth/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.3/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
Was it helpful?

Solution

I found the solution to the problem:

Add a 'Gemfile' in your plugin directory with all the listed gem, hit 'bundle' and then require works flawlessly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top