by Whaat » Sun Jan 17, 2010 6:25 pm
Hey, I downloaded Ruby-prof for profiling my code since it seems way better than the built in Ruby Profiler. However, I'm a bit stuck on how to install and use it. It comes as a GEM file and when I tried to install it from the Windows command line using the code. - Code: Select all
gem install rub-prof
but I got some error about not being able to locate library or something. However, even if I did manage to install it correctly what would the next step be? How do I know which files were installed? I assume that I would have to copy everything that got installed into the SketchUp plugins folder so I need to know all the files that are included in the GEM file. Can anyone provide any guidance here? Thanks
-
Whaat
-
- Posts: 969
- Joined: Wed Nov 14, 2007 9:51 pm
- Location: Saskatchewan, Canada
- Name: Dale Martens
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by tbd » Sun Jan 17, 2010 7:40 pm
did you checked "If you are running Windows, make sure to install the Win32 RubyGem which includes a pre-built binary. Due to a bug in ruby-gems, you cannot install the gem to a path that contains spaces" ? and "If you are running Windows, then install the Windows specific RubyGem which includes an already built extension." or you can download the gem (which is a renamed .zip file), unpack, check the data.tar.gz and see the files that are inside and put them in SU dir. you can also add to the $: the paths from Ruby install and see if it works. use ProcMon to trace the files that it tries to open and see where to put your files.
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by Whaat » Mon Jan 18, 2010 4:25 am
Argghhh! I think i installed all the files correctly in the SketchUp plugins folder and I get this message when SketchUp loads: Error Loading File xxxxxxx.rb 127: The specified procedure could not be found. - C:/Program Files/Google/Google SketchUp 7/Plugins/ruby_prof.so
Seems to be problem with ruby-prof.so which I have placed in the Plugins folder. If someone is able to succesfully install ruby-prof on a windows system, please let me know what you did to get it to work! Download Ruby-prof here: http://rubyforge.org/frs/?group_id=1814 ... e_id=29249Thanks!
-
Whaat
-
- Posts: 969
- Joined: Wed Nov 14, 2007 9:51 pm
- Location: Saskatchewan, Canada
- Name: Dale Martens
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by tbd » Mon Jan 18, 2010 3:17 pm
weird. it loads properly under Ruby command line, but it gives a DLL init error when loading under SU. tried to rebuild with PellesC and I get the same error. I think maybe it is due BugSplat library SEH control that screw things up. my suggestion - get another ruby profiler library 
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by AdamB » Mon Jan 18, 2010 3:21 pm
I've build it on a Mac and works just fine. I had to remove some Rails stuff from the startup but it works pretty nicely too.
Whaat, you should have in you plugins folder:
ruby_prof.so ruby-prof.rb ruby-prof (folder)
ruby-prof.rb just loads all the ancillary files as normal.
Can you give the actual error you get.
-

AdamB
- LightUp
-
- Posts: 762
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by Whaat » Mon Jan 18, 2010 3:30 pm
AdamB wrote:I've build it on a Mac and works just fine. I had to remove some Rails stuff from the startup but it works pretty nicely too.
Whaat, you should have in you plugins folder:
ruby_prof.so ruby-prof.rb ruby-prof (folder)
ruby-prof.rb just loads all the ancillary files as normal.
Can you give the actual error you get.
Hi Adam, I posted the error above. I'm not sure what you mean. And...I put the correct files in the plugins folder as you say. Seems like a Windows issue. I'll have to try it on my Mac yet to see if I can get it to work. Thanks.
-
Whaat
-
- Posts: 969
- Joined: Wed Nov 14, 2007 9:51 pm
- Location: Saskatchewan, Canada
- Name: Dale Martens
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Jim » Mon Jan 18, 2010 3:32 pm
When I installed yaml, I noticed there may be a case issue - I had to use:
require 'Yaml' (or require 'YAML') because require 'yaml' did not work; although the library file names were all lower case. (Windows XP SP 3)
I unfortunately no longer have it installed so I'm going from memory here...
-
Jim
- Global Moderator
-
- Posts: 4126
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: NEOH
- Name: Jim
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Intermediate
-
by tbd » Mon Jan 18, 2010 3:44 pm
AdamB wrote:Can you give the actual error you get.
when in Sketchup, require 'ruby_prof.so' breaks in LoadLibrary function with 'Exception C0000139 Entry Point Not Found' which is weird as it works in normal Ruby
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by Todd Burch » Mon Jan 18, 2010 3:54 pm
Could it be a PATH issue?
-
Todd Burch
-
- Posts: 909
- Joined: Mon Nov 12, 2007 2:43 pm
- Location: Katy, Texas
-
by tbd » Mon Jan 18, 2010 4:35 pm
Could it be a PATH issue?
there is only loading the .so file which has dependency only for kernel32. dll, msvcrt and msvcrt-ruby18 - all loaded by SU anyway.
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by AdamB » Mon Jan 18, 2010 5:29 pm
Yep, I see the same thing here. On windows it simply wont load. I've rebuilt it locally too.
-

AdamB
- LightUp
-
- Posts: 762
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by Dan Rathbun » Tue Jan 19, 2010 3:16 am
TBD wrote:when in Sketchup, require 'ruby_prof.so' breaks in LoadLibrary function with 'Exception C0000139 Entry Point Not Found' which is weird as it works in normal Ruby
What version is the msvcrt-ruby18. dll... ...that works in normal ruby? ...that does NOT work in the SU folder? (I got a similar error when I tried to get SU to load the 1.9.1 version ruby dll)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by tbd » Tue Jan 19, 2010 1:55 pm
Dan: thanks, that was the problem. in Sketchup there were msvcrt-ruby18. dll version 1.8.0 and in Ruby was version 1.8.6replacing the dll in Sketchup dir with the one from Ruby dir I was able to load - Code: Select all
RubyProf.measure_mode = RubyProf::CPU_TIME RubyProf.start Sketchup.active_model.entities.each {|x| x.class} result = RubyProf.stop
File.open "d:/profile.txt", 'w' do |file| RubyProf::FlatPrinter.new(result).print(file) end
- Code: Select all
Thread ID: 32679270 Total: 7.168426
%self total self wait child calls name 48.70 4.38 3.49 0.00 0.89 1 Sketchup::Entities#each 20.50 7.17 1.47 0.00 5.70 1 Global#[No method] 12.39 0.89 0.89 0.00 0.00 23 Kernel#class 11.84 0.85 0.85 0.00 0.00 1 <Module::Sketchup>#active_model 6.57 0.47 0.47 0.00 0.00 1 Sketchup::Model#entities
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by Whaat » Tue Jan 19, 2010 2:49 pm
Awesome! Thanks everyone! I hope I can get it working too...
-
Whaat
-
- Posts: 969
- Joined: Wed Nov 14, 2007 9:51 pm
- Location: Saskatchewan, Canada
- Name: Dale Martens
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by Dan Rathbun » Tue Jan 19, 2010 7:47 pm
TBD wrote:Dan: thanks, that was the problem. in Sketchup there were msvcrt-ruby18.dll version 1.8.0 and in Ruby was version 1.8.6
replacing the dll in Sketchup dir with the one from Ruby dir I was able to load RubyProf
I thought so! I always tell people, IF your using full ruby libraries with Sketchup... to make the msvcrt-ruby18. dll file in the Sketchup program folder/directory, the SAME version as your full ruby version. Otherwise your asking for Errors (such as newer library scripts calling methods that the older interpreter doesn't understand.) I've given this advice several times over at Google Groups SU Developer's forum. Not sure if I have here. I also always say make a Sketchup/_BACKUP folder and drag the older DLL into that folder, before copying the newer 'full' DLL from the ruby/bin folder. (You never know, you may have a future need to test a script, running under the old DLL version.) Glad I could help. @Jim: Maybe this issue needs to be added to the Ruby Tips for Sketchup Sticky Links page?
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Tue Jan 19, 2010 11:03 pm
Re: Ruby Interpreter DLL: SketchUp vs StandardI downloaded the normal standard v 1.8.0 patch level 10 DLL (msvcrt-ruby18. dll) from: http://www.oldapps.com/Ruby.php?old_ruby=12and compared it against the backup that was installed with Sketchup v7.0 application. Both standard DOS command comp and the Support Tool WinDiff report both DLL files are identical. * (WinDiff is a file comparison utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exe to install the tools.)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Tue Jan 19, 2010 11:11 pm
Re: Ruby Interpreter DLL: SketchUp vs StandardThe Support Tool bindiff.exe reports both files are identical. DOS cmd shell in folder: C:\Program Files\Google\Google SketchUp 7\_Backup - Code: Select all
>bindiff /c msvcrt-ruby18.dll v180-10\msvcrt-ruby18.dll
Identical 811,008 bytes
File Count Summary Identical: 1 files Near Identical: 0 files Different: 0 files Left Only: 0 files Right Only: 0 files Errors: 0 files Total: 1 files
Byte Count Summary Matched: 0 bytes differ Left Only: 0 bytes Right Only: 0 bytes Total: 0 bytes
* (bindiff is a binary file comparison utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exe to install the tools.)
Last edited by Dan Rathbun on Thu Jan 21, 2010 3:16 am, edited 1 time in total.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Tue Jan 19, 2010 11:18 pm
Re: Ruby Interpreter DLL: SketchUp vs StandardThe Support Tool filever.exe displays versioning information inside exe and dll files: DOS cmd shell, filever verbose listing, in folder: C:\Program Files\Google\Google SketchUp 7\_Backup This is the DLL file distro'd with Sketchup 7.x- Code: Select all
>filever msvcrt-ruby18.dll /v --a-- W32i DLL - 1.8.0.0 shp 811,008 02-19-2009 msvcrt-ruby18.dll
Language 0x0000 (Language Neutral) CharSet 0x04b0 Unicode OleSelfRegister Disabled FileDescription Ruby interpreter InternalName msvcrt-ruby18.dll OriginalFilenam msvcrt-ruby18.dll ProductVersion 1,8,0,0 FileVersion 1,8,0,0 LegalCopyright Copyright (C) 1993-2003 Yukihiro Matsumoto OleSelfRegister Disabled
VS_FIXEDFILEINFO: Signature: feef04bd Struc Ver: 00010000 FileVer: 00010008:00000000 (1.8:0.0) ProdVer: 00010008:00000000 (1.8:0.0) FlagMask: 0000003f Flags: 00000000 OS: 00000004 Win32 FileType: 00000002 Dll SubType: 00000000 FileDate: 00000000:00000000 This is the DLL file distro'd with Ruby ver 1.8.0-10- Code: Select all
>filever v180-10\msvcrt-ruby18.dll /v --a-- W32i DLL - 1.8.0.0 shp 811,008 08-11-2003 msvcrt-ruby18.dll
Language 0x0000 (Language Neutral) CharSet 0x04b0 Unicode OleSelfRegister Disabled FileDescription Ruby interpreter InternalName msvcrt-ruby18.dll OriginalFilenam msvcrt-ruby18.dll ProductVersion 1,8,0,0 FileVersion 1,8,0,0 LegalCopyright Copyright (C) 1993-2003 Yukihiro Matsumoto OleSelfRegister Disabled
VS_FIXEDFILEINFO: Signature: feef04bd Struc Ver: 00010000 FileVer: 00010008:00000000 (1.8:0.0) ProdVer: 00010008:00000000 (1.8:0.0) FlagMask: 0000003f Flags: 00000000 OS: 00000004 Win32 FileType: 00000002 Dll SubType: 00000000 FileDate: 00000000:00000000
* (filever is a file version utility that is installed with Windows Support Tools. The Support Tools are not installed automatically with Windows. You must manually browse the WIN install CD to the "Support Tools" folder, and run a separate setup.exe to install the tools.)
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by AdamB » Wed Jan 20, 2010 9:54 am
Given there are many fixes between 1.8.0 and 1.8.6 - and using 1.8.6 doesn't seem to cause problems - I don't know why Google are shipping quite so old a dll. In particular, I noticed a few fixes in the changelogs to Ruby related to memory leaks.
FYI Mac Sketchup uses 1.8.5
Adam
-

AdamB
- LightUp
-
- Posts: 762
- Joined: Wed Dec 12, 2007 10:49 am
- Location: Brighton, UK
- Name: AdamB
by Dan Rathbun » Thu Jan 21, 2010 4:01 am
AdamB wrote:... I don't know why Google are shipping quite so old a dll. ...
It may just be a staffing issue, they know it works with 1.8.0, but are probably reluctant to ship with 1.8.6 without massive testing. I can see management feeling such an task as being low priority. There was also at least one person at Google, who thought wrongly ( the removed quote above,) that Ruby for Sketchup had to remain at v1.8.0 because the DLL ( they thought,) had been extensively modified and compiled specially for Sketchup; and that to update to 1.8.6 or any other later release would be a huge project, not likely to occur any time soon. __Well, I think I've proved that assumption incorrect. The Ruby Interpreter DLLs are just copies of those distro'd with standard Ruby. AdamB wrote:Given there are many fixes between 1.8.0 and 1.8.6 - and using 1.8.6 doesn't seem to cause problems - ... In particular, I noticed a few fixes in the changelogs to Ruby related to memory leaks.
A good reason to use 1.8.6 with Sketchup, and I have been since a few days after I installed 7.0 (and have had no problems, so far.) I would feel that 1.8.7 is still not ready (it just had a recent release to fix major security bugs.) But it's almost there. I tried to get Sketchup to load 1.9.1, but it did not like the DLL. I got the 'Entry Point Not Found' error. (Not sure if it was the Ruby guys who changed things, or if it was me renaming the msvcrt-ruby191.dll_ to msvcrt-ruby18.dll_ that was the problem.) There are those of us, who wish to run newer Ruby releases (especially the non-english users who need multibyte character support in the 1.9.x branch.) We should be able to run any Ruby release we wish.. and it would be nice if Sketchup was setup to facilitate our choice. AdamB wrote:FYI Mac Sketchup uses 1.8.5
I suspect because of the major differences in OSX and Win32 programming, that there are different people working on the two implementations. Does OSX Leopard come with ver 1.8.5 pre-installed? _
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Whaat » Fri Jan 22, 2010 5:10 am
hmmm...I replaced the original DLL with the 1.8.6 version and I am now getting this message at Startup Error Loading File ruby-prof.rb no such file to load -- erb I have ruby-prof.so, ruby-prof.rb and the ruby-prof folder in my plugins folder.  Any ideas?
-
Whaat
-
- Posts: 969
- Joined: Wed Nov 14, 2007 9:51 pm
- Location: Saskatchewan, Canada
- Name: Dale Martens
- Operating system: Windows
- SketchUp version: 8
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
-
by tbd » Fri Jan 22, 2010 8:16 am
comment out these lines from ruby-prof.rb if you dont want pretty outputs or add erb.rb to your ruby-prof dir (I choosed the first one  ) - Code: Select all
require "ruby-prof/graph_printer" require "ruby-prof/graph_html_printer"
-

tbd
-
- Posts: 1018
- Joined: Wed Nov 14, 2007 10:47 am
- Location: Romania
- Name: TBD
-
by Dan Rathbun » Fri Jan 22, 2010 8:19 am
AdamB wrote:I've build it on a Mac and works just fine. I had to remove some Rails stuff from the startup but it works pretty nicely too. erb.rb is in the standard ruby library. If you have a full ruby install, you need to add paths to the $: ($LOAD_PATH) array. [OR.. you could try to comment the stuff for erb out and see if it runs.] Here's a little script I had posted over at Google Groups for Win32 to load standard ruby paths. -- !loadpaths.rb --CODE moved to it's own post and updated. (06 JUL 2010)http://forums.sketchucation.com/viewtopic.php?f=180&t=29412Anyone want to make a Mac version out of this?_
Last edited by Dan Rathbun on Wed Jul 07, 2010 2:57 am, edited 1 time in total.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Fri Feb 12, 2010 8:19 pm
Dan Rathbun wrote:Anyone want to make a Mac version out of this? _
making one is out of my league, but I'd like to use it if someone does, I'm attempting to learn ruby as my first, ever, programming language, any tools that work with ruby, SU and Mac should aid may grasp on the mechanics... any other recommendations welcome. john EDIT: I was digging around in systems library and came across this, can anyone shine a light on it's meaning and if it may be causing any of the many Mac ruby glitches that rear their heads. Notes on building the stand-alone reader. 1. When trying to link with only MacWin and Utils, EqualTol came up as an unresolved external, so someone must be including Tol.h or something at the wrong level. 2. Text.cpp in Model includes BaseApp/BaseAppServices.h. It is calling GetActiveView(). It should be restructured so that it doesn't need to call this. 3. Model/MergeController.cpp is calling AppServices::GetUndoManager() which is not defined at the Model level. 4. InstancePath.cpp and SectionPlane.cpp both reference CPickRecord which is not defined at the Model level. 5. SteStatusText should be removed from PushPullController.cpp 6. The output variable for OpenDocument should be of type IDocument rather than IDispatch. 7. Need Mac implementations of OpenDocument and CloseDocument. (added in special reader version of XApplication.cpp) 8. OpenDocument and CloseDocument are not implemented in the standard version of XApplicaiton. I have copied XAxpplication to the Reader folder so that I can implement this for the reader without changing SketchUp. After 3.0 releases, these implementations should be merged. 9. IApplication::CloseDocument is a worthless method. There should really be a Close method on Document instead. Or at least CloseDocument should take an argument to tell you which document you should close. Maybe XDocument should delete the CSketchUpModel if it was created by a call to OpenDocument? 10. Some methods still return IDispatch* rather than the real type. For example, get_Relationships.
-
driven
- Top SketchUcator
-
- Posts: 1455
- Joined: Fri May 01, 2009 11:50 pm
- Name: John
- Operating system: Mac
- SketchUp version: 2013
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Sat Feb 13, 2010 8:50 am
driven wrote: EDIT: I was digging around in systems library and came across this, can anyone shine a light on it's meaning and if it may be causing any of the many Mac ruby glitches that rear their heads.
Notes on building the stand-alone reader.
That looks like it refers to the C++ files for building the SKP Reader extension for a third-party application. So those 'issues' are C++ issues with the SKP Reader SDK, not Sketchup itself or the SU Ruby API.
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by dney » Tue Feb 07, 2012 4:32 am
I was trying to use a gem named "cfpropertylist" to create an export script on Mac OS X (Lion) with sketchup 8. I had lots of problems, but finally got it working. Others using Mac may be interested. I installed the GEM to the standard OS X installed ruby (version 1.8.7). I did "sudo gem install CFPropertyList-2.0.17.gem". That worked, but messed up the permissions on the files so non-superusers could not read the files. I think this may be because I had a weird umask. I used /bin/find to fix that up. Then I could require cfpropertylist in an irb session. I then tried to require it in a sample script I loaded in the sketchup ruby console. But it got a file not found. I found a post about replacing the ruby provided with sketchup with the standard OS X ruby on stack overflow: http://stackoverflow.com/questions/3333163/how-to-update-ruby-in-google-sketchup. That worked even thou I have sketchup 8 (and there was no Headers there originally, but I linked one in anyways). I also saw posts about modifying LOAD_PATH to include the standard dirs. So I put this at the front of my test script: - Code: Select all
osx_stdlibpath = ["/Library/Ruby/Site/1.8", "/Library/Ruby/Site/1.8/powerpc-darwin11.0", "/Library/Ruby/Site/1.8/universal-darwin11.0", "/Library/Ruby/Site", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby/1.8/universal-darwin11.0", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/powerpc-darwin11.0", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0", "."]
$LOAD_PATH.concat(osx_stdlibpath) $LOAD_PATH.uniq!
It still did not work. Finally I figured out that I had to require the stuff for GEM in order for it to find the package. Guess it makes sense--I think irb was including the GEM loader for me. So I put this into my script after the code modifying LOAD_PATH: - Code: Select all
require 'rubygems'
And finally the require of CFPropertyList worked! -Derek
-
dney
-
- Posts: 1
- Joined: Tue Feb 07, 2012 4:18 am
- Name: Derek
by Dan Rathbun » Tue Feb 07, 2012 1:33 pm
Good job Derek ! 1) Now can you d/l and install gems from within Sketchup embedded Ruby ?? 2) You are running OSX Lion, so I assume your machine is Intel based. I wonder why you need to add platform dir paths for a PowerPC (MacOS9) platform ?? 3) The following dir paths should not have files in them, only subdirs. Why add them ?? - "/Library/Ruby/Site"
- "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby"
4) You also add the current working directory, ie: " ." (which can change from time to time, via calls to Dir.chdir in other author's plugins.) So, is this necessary for RubyGems ?? 5) After require('rubygems') returns (sucessfully,) has it added any paths to the $LOAD_PATH array ??
-

Dan Rathbun
- Top SketchUcator
-
- Posts: 4146
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
Return to Developers' Forum
|