[Ruby] LoadError: no such file to load -- json

491 views
Skip to first unread message

Ruban

unread,
Mar 13, 2013, 2:09:08 PM3/13/13
to cu...@googlegroups.com
Hi All,

Getting a weird issue of Load Error as below,

  [echo] Running Cucumber Ruby Features
     [java] LoadError: no such file to load -- json
     [java]   require at org/jruby/RubyKernel.java:1038
     [java]   require at file:/opt/glassfishv3/.m2/repository/org/jruby/jruby-complete/1.6.4/jruby-complete-1.6.4.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29
     [java]    (root) at step_definitions/create_contact_csl_steps.rb:3
     [java] Exception in thread "main" org.jruby.embed.EvalFailedException: (LoadError) no such file to load -- json
     [java] 	at org.jruby.embed.internal.EmbedEvalUnitImpl.run(EmbedEvalUnitImpl.java:127)
     [java] 	at org.jruby.embed.ScriptingContainer.runUnit(ScriptingContainer.java:1231)
     [java] 	at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1247)
     [java] 	at cucumber.runtime.jruby.JRubyBackend.runScriptlet(JRubyBackend.java:86)
     [java] 	at cucumber.runtime.jruby.JRubyBackend.loadGlue(JRubyBackend.java:65)
     [java] 	at cucumber.runtime.Runtime.<init>(Runtime.java:64)
     [java] 	at cucumber.runtime.Runtime.<init>(Runtime.java:51)
     [java] 	at cucumber.cli.Main.run(Main.java:18)
     [java] 	at cucumber.cli.Main.main(Main.java:12)
     [java] Caused by: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- json

feature file has the following in the first three lines,
require 'java'
require 'rubygems'
require 'json'

What should be the Best solution to resolve the above thing,

Pleas let me know your suggestions.

Thanks,
Ruban

Oleg Sukhodolsky

unread,
Mar 14, 2013, 3:12:02 AM3/14/13
to cu...@googlegroups.com
Hi Ruban,

It looks like either your test or cucumber itself wants to use json gem.
If it is your code then ad json to your Gemfile, if it is cucumber then it is a bug please file a ticket about it (with test if possible)

Regards, Oleg.



--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

aslak hellesoy

unread,
Mar 14, 2013, 3:26:43 AM3/14/13
to Cucumber Users
On Wed, Mar 13, 2013 at 6:09 PM, Ruban <ruban....@gmail.com> wrote:
Hi All,

Getting a weird issue of Load Error as below,


What cucumber and gherkin versions do you have?
The gherkin gem depends on the json gem [1], so if you have cucumber and gherkin installed you should have json as well, unless you manually uninstalled it.


Oleg, when the next release of gherkin 2.x is made with multi_json - will users manually have to add their own preferred json gem? My understanding is that multi_json expects the user to have a json parser gem installed and won't work if it can't find one.

Aslak

Oleg Sukhodolsky

unread,
Mar 14, 2013, 4:01:37 AM3/14/13
to cu...@googlegroups.com
On Thu, Mar 14, 2013 at 11:26 AM, aslak hellesoy <aslak.h...@gmail.com> wrote:



On Wed, Mar 13, 2013 at 6:09 PM, Ruban <ruban....@gmail.com> wrote:
Hi All,

Getting a weird issue of Load Error as below,


What cucumber and gherkin versions do you have?
The gherkin gem depends on the json gem [1], so if you have cucumber and gherkin installed you should have json as well, unless you manually uninstalled it.


Oleg, when the next release of gherkin 2.x is made with multi_json - will users manually have to add their own preferred json gem? My understanding is that multi_json expects the user to have a json parser gem installed and won't work if it can't find one.

it works with some default implementation but warns about it and suggests to use something else.

Oleg.
Reply all
Reply to author
Forward
0 new messages