Re: [ruby maybe?] httparty and openssl

267 views
Skip to first unread message

Asher Vilensky

unread,
Oct 11, 2012, 3:25:19 PM10/11/12
to cu...@googlegroups.com
Update:

I was able to overcome the openssl issue (by reinstalling ruby 1.9.3).  However, I still get a load error for whichever is the required gem in the .rb file.  So for example, I changed the order of the required gems below to be:

require 'rubygems'
require 'yajl'
require 'json-compare'
require 'test/unit'
require 'httparty'

Notice that I moved httparty to the bottom of the list.  Now I get a load error for yajl:

$ cucumber
cannot load such file -- yajl (LoadError)


So it seems that the process cannot find the gems - even though they are all installed.

So I put the above list in a foo.rb file and ran it like this:
$ ruby foo.rb

It ran fine.  It didn't complain.  So I'm suspecting it's cucumber who can't load the gems, but I'm not sure why or how to fix it.

Thanks in advance for any help.

On Thursday, October 11, 2012 1:11:17 PM UTC-4, Asher Vilensky wrote:
Hi.  My first ever post to the group.
I'm on Ubuntu 12.04.

The top of my step definition file looks like this:

require 'rubygems'
require 'httparty'
require 'yajl'
require 'json-compare'
require 'test/unit'

cucumber gives me the following error:

$ cucumber
cannot load such file -- httparty (LoadError)
/home/asher/Dropbox/QA/Cucumber/API/zuora/prodcat/features/step_definitions/prodcat.rb:2:in `require'
.....
.....

httparty is installed:

$ gem list --local | grep httpartyhttparty (0.9.0)


When I go to the irb prompt I get this:

1.9.3-p194 :001 > require 'httparty'
LoadError: cannot load such file -- openssl

However, openssl is installed:

$ which openssl
/usr/bin/openssl


Any idea what might be going on?
Thanks.

aslak hellesoy

unread,
Oct 11, 2012, 3:35:02 PM10/11/12
to cu...@googlegroups.com
On Thu, Oct 11, 2012 at 8:25 PM, Asher Vilensky <dor...@gmail.com> wrote:
> Update:
>
> I was able to overcome the openssl issue (by reinstalling ruby 1.9.3).
> However, I still get a load error for whichever is the required gem in the
> .rb file. So for example, I changed the order of the required gems below to
> be:
>
> require 'rubygems'
>
> require 'yajl'
> require 'json-compare'
> require 'test/unit'
> require 'httparty'
>
> Notice that I moved httparty to the bottom of the list. Now I get a load
> error for yajl:
>
> $ cucumber
> cannot load such file -- yajl (LoadError)
>
>
> So it seems that the process cannot find the gems - even though they are all
> installed.
>
> So I put the above list in a foo.rb file and ran it like this:
> $ ruby foo.rb
>
> It ran fine. It didn't complain. So I'm suspecting it's cucumber who can't
> load the gems, but I'm not sure why or how to fix it.
>

Cucumber doesn't load gems. The ruby interpreter does.
Are you using rvm? rvm gemsets? bundler?
It's most likely something to do with one of these - or your ruby
installation. I doubt it's cucumber related.
What happens if you run `bundle exec cucumber`?

Aslak
> --
> -- 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
>
>

Asher Vilensky

unread,
Oct 11, 2012, 3:49:02 PM10/11/12
to cu...@googlegroups.com


Yes, using rvm.

$ bundle exec cucumber

cannot load such file -- yajl (LoadError)
/home/asher/Dropbox/QA/Cucumber/API/zuora/prodcat/features/step_definitions/prodcat.rb:2:in `require'
/home/asher/Dropbox/QA/Cucumber/API/zuora/prodcat/features/step_definitions/prodcat.rb:2:in `<top (required)>'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:174:in `load_step_definitions'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/runtime.rb:40:in `run!'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:43:in `execute!'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/lib/cucumber/cli/main.rb:20:in `execute'
/home/asher/.rvm/gems/ruby-1.9.3-p194/gems/cucumber-1.1.3/bin/cucumber:14:in `<top (required)>'
/home/asher/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:19:in `load'
/home/asher/.rvm/gems/ruby-1.9.3-p194/bin/cucumber:19:in `<main>'
/home/asher/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
/home/asher/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'


 

Asher Vilensky

unread,
Oct 15, 2012, 9:53:18 AM10/15/12
to cu...@googlegroups.com
This problem is resolved.  I created a new (identical) Ubuntu VM and installed everything as the user (sudo apt-get) - previously I installed everything as root.
Just wanted to close the loop for anybody who ever comes across this posting.  Thanks for all the help.
Reply all
Reply to author
Forward
0 new messages