PrimalWyld
PrimalWyld

Reputation: 115

Unable run basic script

This issue appears to be happening with every require statement I attempt to use in my ruby script.

How do I get ruby to properly use the gem?

Here is the ruby script:

require_relative 'oga'

handle = File.open("xml_list.xml")
document = Oga.parse_xml(handle)
print document.css("listitem").first
f.close

Here is the output when I run sudo ruby extract_list.rb in terminal:

Ignoring executable-hooks-1.3.2 because its extensions are not built.  Try: gem pristine executable-hooks --version 1.3.2
Ignoring ffi-1.9.6 because its extensions are not built.  Try: gem pristine ffi --version 1.9.6
Ignoring gem-wrappers-1.2.4 because its extensions are not built.  Try: gem pristine gem-wrappers --version 1.2.4
/Users/sparks/.rbenv/versions/2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- ./oga (LoadError)
from /Users/sparks/.rbenv/versions/2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from extract_list.rb:1:in `<main>'

Upvotes: 0

Views: 198

Answers (1)

PrimalWyld
PrimalWyld

Reputation: 115

Found the source of the problem. I had an old rvm ruby that broke when I upgraded to Yosemite. I had to sudo rvm uninstall all to fix the problem.

Now everything is working properly. :)

Upvotes: 1

Related Questions