Skip to content

How do you load gems?  #62

@NigelThorne

Description

@NigelThorne

I want a plugin to use 'parslet'.

I have something like this...

class AutoBuildPlugin
  include Purugin::Plugin, Purugin::Colors
  description 'AutoBuild', 0.1
  gem "parslet"


  def on_enable
    require 'parslet'
    #...
  end
end

I get the following error on the server...

[16:41:38 INFO]: [AutoBuild] version 0.1 DISABLED
[16:41:38 INFO]: unable to load gem: parslet
[16:41:38 ERROR]: Error occurred (in the plugin loader) while enabling AutoBuild v0.1 (Is it up to date?)
org.jruby.exceptions.RaiseException: (LoadError) Could not find 'parslet' (>= 0) among 5 total gem(s)
Checked in 'GEM_PATH=/root/.gem/jruby/1.9:file:/ssd/var/stipedata/servers/nigel%20mct%201/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/
ruby/gems/shared:plugins/PuruginPlugin/gems', execute `gem env` for more information
at RUBY.to_specs(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb
:315) ~[?:?]
at RUBY.to_spec(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/dependency.rb:
324) ~[?:?]
at RUBY.gem(/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_ge
m.rb:64) ~[?:?]
at RUBY.process_gems(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:204) ~[?:?]
at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1341) ~[purugin-0.8.0-bukkit-1.7.9-R0.2.jar:?]
at RUBY.process_gems(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:196) ~[?:?]
at RUBY.onEnable(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/plugin.rb:139) ~[?:?]
at AutoBuildPlugin_582808228.onEnable(AutoBuildPlugin_582808228.gen:13) ~[?:?]
at RUBY.enable_plugin(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/change_listener.rb:55) ~[?:?]
at RUBY.restart_plugin(file:/ssd/var/stipedata/servers/nigel mct 1/stipe_user_9665513/plugins/purugin-0.8.0-bukkit-1.7.9-R0.2.jar!/purugin/change_listener.rb:65) ~[?:?]

The failed load reports having plugins/PuruginPlugin/gems in the GEM_HOME path.
I tried uploading the parslet gem to that folder... creating:

/plugins/PuruginPlugin/gems/parslet-1.8.0

This didn't help.

I tried adding ENV["GEM_HOME"] = "./gems" to the plugin before the require... no effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions