在SketchUp中需要rubygems

时间:2012-09-18 15:57:44

标签: ruby plugins sketchup

我一直试图在网上搜索如何在SketchUp中使用rubygems,但一直无法找到具体的方法。

以下是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'

我收到以下错误:

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

但是,thread.so正好在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

尝试在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: 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个问题

  1. 为什么C:/Ruby186/lib/ruby/1.8/i386-mingw32中的某些文件可以正确使用,而有些文件却无法提示LoadError?
  2. 为什么最后两行都返回true?是否与装载问题有关?
  3. 环境

    • Windows 7
    • Ruby 1.8.6
    • SketchUp 8.0.14346

    PS。 Another same issue here

0 个答案:

没有答案