views:

37

answers:

2

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

+1  A: 

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.

Jörg W Mittag
I needed to run the script from the path that it existed in or make ruby aware of the file in the load path thanks.
theprojectabot
I couldnt just say ruby /Library/<fullpath to script> instead I needed to cd to the file path.. and even then I had to make sure to run it in arch -i386 mode as there were some 32bit dependancies.
theprojectabot
+1  A: 

Run gem list. Is EngineAPIWrapper mentioned?

Andrew Grimm
thanks yeah its not a bundled gem unfortunately.
theprojectabot