Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Can't using Ruby Gems #28

Open
yurifarod opened this issue Dec 18, 2018 · 11 comments
Open

Can't using Ruby Gems #28

yurifarod opened this issue Dec 18, 2018 · 11 comments

Comments

@yurifarod
Copy link

Hello everybody,
Maybe this doubt seems to be very simple, but I'm caught in there a lot of time.
First i follow the steps from the samples using de JRuby to install a gem in the Ruby Extension directory (inside and outsid of directory "../data-integration\plugins\ruby-for-pentaho-kettle\gems").
In this case i receive the Error message: " org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- chronic"
I tryin change RUBY_GEM_HOME and GEM_HOME like the Sample, but in this case the Ruby Extension crash and not work.
I need to point out that i use the Extension in many projects in Production Environment.

If anybody have a little video, images or a clear explanation of how you configure the environment to use Gems I would be very grateful.
Thank u everybody.

@yurifarod
Copy link
Author

Another information i'm using Windows 10, is this a impediment?

@slawo-ch
Copy link
Member

Which gem is it that you're trying to install?

@yurifarod
Copy link
Author

I need use one script with the gem 'classifier-reborn', but i tried tests with 'chronic' (when i followed the steps of sample) and i cant't use this gem either.

@slawo-ch
Copy link
Member

slawo-ch commented Dec 20, 2018

I was able to reproduce the issue. It seems JRuby changed the way they handle gem paths at some point. I'm looking into it. In the meantime, you can export GEM_HOME=/path/to/your/gems in spoon.sh as a workaround. If you're on windows you'll probably need to set GEM_HOME as an environment variable.

The JRuby runtime picks up on that environment variable even when running a scripting container.

@slawo-ch
Copy link
Member

I've released version 1.3.5 that upgrades JRuby and fixes setting the default GEM_HOME. Give it a spin and see if it works.

@yurifarod
Copy link
Author

I replaced the vesion 1.3.4 for this. My other transformation with Ruby still working, but the script with "require 'chronic'" still not working..
This is the full message of error:

"2018/12/20 10:31:10 - Ruby Script.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Unexpected error
2018/12/20 10:31:10 - Ruby Script.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : org.pentaho.di.core.exception.KettleException:
2018/12/20 10:31:10 - Ruby Script.0 - org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- chronic
2018/12/20 10:31:10 - Ruby Script.0 - (LoadError) no such file to load -- chronic
2018/12/20 10:31:10 - Ruby Script.0 -
2018/12/20 10:31:10 - Ruby Script.0 - at com.twineworks.kettle.ruby.step.execmodels.SimpleExecutionModel.onProcessRow(SimpleExecutionModel.java:602)
2018/12/20 10:31:10 - Ruby Script.0 - at com.twineworks.kettle.ruby.step.RubyStep.processRow(RubyStep.java:51)
2018/12/20 10:31:10 - Ruby Script.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2018/12/20 10:31:10 - Ruby Script.0 - at java.lang.Thread.run(Thread.java:748)
2018/12/20 10:31:10 - Ruby Script.0 - Caused by: org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- chronic
2018/12/20 10:31:10 - Ruby Script.0 - at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:131)
2018/12/20 10:31:10 - Ruby Script.0 - at com.twineworks.kettle.ruby.step.execmodels.SimpleExecutionModel.onProcessRow(SimpleExecutionModel.java:580)
2018/12/20 10:31:10 - Ruby Script.0 - ... 3 more
2018/12/20 10:31:10 - Ruby Script.0 - Caused by: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- chronic
2018/12/20 10:31:10 - Ruby Script.0 - at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:983)
2018/12/20 10:31:10 - Ruby Script.0 - at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:59)
2018/12/20 10:31:10 - Ruby Script.0 - at RUBY.

(Ruby Script:1)"

@slawo-ch
Copy link
Member

You do have the chronic gem installed though, right?

@yurifarod
Copy link
Author

Off course!
"irb(main):001:0> require 'chronic'
=> true"

@slawo-ch
Copy link
Member

Hmm, seems like I had my GEM_HOME exported manually when I verified the last solution. Let me look at it again. In the meantime, having GEM_HOME set as an environment variable seems to work as a workaround.

@slawo-ch
Copy link
Member

Just released 1.3.6, would you like to give that a test?

@yurifarod
Copy link
Author

Don't work yet.
I use the CPython from marketplace to resolve my problem (because it was urgent), but I really wish I could use yours Ruby App to futures problem.
I'm a Ruby entusiast and developer a many time.

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

No branches or pull requests

2 participants