I have been trying to find out searching online how to require rubygems
in SketchUp, but have been unable to find out specifically how.
Below is my plugin in C:\Program Files\Google\Google SketchUp 8\Plugins\gems.rb:
$: << 'C:/Ruby186/lib/ruby/site_ruby/1.8'
$: << 'C:/Ruby186/lib/ruby/site_ruby/1.8/i386-msvcrt'
$: << 'C:/Ruby186/lib/ruby/site_ruby'
$: << 'C:/Ruby186/lib/ruby/1.8'
$: << 'C:/Ruby186/lib/ruby/1.8/i386-mingw32'
$: << '.'
require 'rubygems'
And I got the following error:
Error: #<LoadError: C:/Ruby186/lib/ruby/1.8/i386-mingw32/thread.so: 127: The specified procedure could not be found. - C:/Ruby186/lib/ruby/1.8/i386-mingw32/thread.so>
(eval):14
C:/Ruby186/lib/ruby/1.8/thread.rb:5
C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems.rb:11:in `require'
C:/Ruby186/lib/ruby/site_ruby/1.8/rubygems.rb:11
(eval):14:in `require'
(eval):14
However, thread.so is exactly in C:/Ruby186/lib/ruby/1.8/i386-mingw32:
C:\Ruby186\lib\ruby\1.8\i386-mingw32>ls
Win32API.so digest.so fcntl.so openssl.so sdbm.so version.h
bigdecimal.so dl.h gdbm.so racc socket.so win32
config.h dl.so iconv.so rbconfig.rb st.h win32ole.so
curses.so dlconfig.h intern.h re.h stringio.so zlib.so
dbm.so dln.h io regex.h strscan.so
defines.h enumerator.so missing.h ruby.h syck.so
digest env.h nkf.so rubyio.h thread.so
digest.h etc.so node.h rubysig.h util.h
Trying to test in SketchUp Ruby Panel:
> require 'bigdecimal'
true
> require 'curses'
true
> require 'dbm'
true
> require 'digest'
true
> require 'digest/md5'
Error: #<LoadError: C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest/md5.so: 126: The specified procedure could not be found. - C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest/md5.so>
(eval):14
(eval):14
> require 'digest\md5'
Error: #<LoadError: C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest\md5.so: 126: The specified procedure could not be found. - C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest\md5.so>
(eval):14
(eval):14
> require 'digest/sha1'
Error: #<LoadError: C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest/sha1.so: 126: The specified procedure could not be found. - C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest/sha1.so>
(eval):14
(eval):14
> require 'digest\sha1'
Error: #<LoadError[:][1] C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest\sha1.so: 126: The specified procedure could not be found. - C:/Ruby186/lib/ruby/1.8/i386-mingw32/digest\sha1.so>
(eval):14
(eval):14
> require 'digest\sha2'
true
> require 'digest/sha2'
true
2 Questions
Why some of files in C:/Ruby186/lib/ruby/1.8/i386-mingw32 can be required correctly, while some can’t and prompt LoadError?Why the last two lines return both true? Does is has something to do with the loading problem?
Environment
Windows 7
Ruby 1.8.6
SketchUp 8.0.14346