Simple ruby interpreter problem : `require': no such file to load -- (LoadError)
I get this when I run a main.rb file from OSX command line
`require': no such file to load -- EngineAPIWrapper (LoadError)
I have tried putting all the files that it references within the same folder instead of sym links but I still get the problem
if I require 'rubygems' at开发者_如何学C the top of the main.rb file I get this error instead:
link-mbp:~ benb$ ruby /Library/Application\ Support/Episode/Engine/SDK/Samples/ruby/xmlrpc/engine_client.rb
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- EngineAPIWrapper (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from /Library/Application Support/Episode/Engine/SDK/Samples/ruby/xmlrpc/engine_client.rb:14
The top of the source file looks like this:
require 'rubygems'
require 'xmlrpc/client'
require 'EngineAPIWrapper'
require 'pp'
require 'English'
that is, I don't see anything wrong with how I am running things.
Any help is appreciated!
In 99% of all cases, when a computer tells you that it couldn't find something, the reason is that it is not there. In the other 1% of cases, the computer is looking in the wrong place.
So, in order for require 'EngineAPIWrapper'
to work, there has to be a file named EngineAPIWrapper.rb
and that file has to be in a directory which is in Ruby's $LOAD_PATH
.
Run gem list
. Is EngineAPIWrapper mentioned?
精彩评论