Mac $LOAD_PATH and Examples Scripts Extension
-
(in response to this topic)
@dan rathbun said:
MacOSX will automatially load both paths
the /Users/username path is only added if the Ruby Script Examples extension has been enabled. This may have been the cause of some confusion in the past with the Podium and Subdivide plugins.
Check out the very bottom of the
examples/examplescript.rb
script to see. It's just the wrong place to be making that change.(Checked in version 7 on Mac - can't run
Path before and after enabling Ruby Script Examples.
-
hi Jim, without touching a thing, and NO examplescripts.rb I get this on v8 with OSX 10.5.6...
> $; ["/Library/Application Support/Google SketchUp 8/SketchUp/Plugins", "/Users/johns_iMac/Library/Application Support/Google SketchUp 8/SketchUp/Tools", "/Library/Application Support/Google SketchUp 8/SketchUp/Tools", "/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/TT_Lib/ruby_lib/"]
when I move examplescripts.rb to plugins
Error Loading File examplescripts.rb undefined method `GetString' for nil;NilClass
which is odd because it was working in 8 before I did a plugins re-orginisation 2 days ago.
I noticed gear3.rb had given this message yesterday when I put it back in, so there may be some difference between upgrading from 7 with plugins installed and fresh instals...but if I add in examples.rb, as well, 'GetString' error goes away for this and gear3
I don't have a plugins folder @ ~, but I'm sure examplesript use to write it, so I added an empty Plugins folder @~ and I get this
> $; ["/Users/johns_iMac/Library/Application Support/Google SketchUp 8/SketchUp/Plugins", "/Library/Application Support/Google SketchUp 8/SketchUp/Plugins", "/Users/johns_iMac/Library/Application Support/Google SketchUp 8/SketchUp/Tools", "/Library/Application Support/Google SketchUp 8/SketchUp/Tools", "/Users/johns_iMac", "/Library/Application Support/Google SketchUp 8/SketchUp/Plugins/TT_Lib/ruby_lib/"]
If I then remove examples.rb and examplescript.rb I still get both paths, but gear3 is show the 'GetString error',
last step I remove Plugin folder (and gear3) and all is back to the same as the first entry here...john
-
John,
I don't know what to make of it.
@driven said:
when I move examplescripts.rb to plugins
I'm not sure why you would move it. It belongs in SketchUp's Plugins/examples folder and is loaded when the Ruby Example Scripts extension is enabled.
@unknownuser said:
but if I add in examples.rb, as well, 'GetString' error goes away for this and gear3
gear3.rb has no reason to use GetString - GetString is designed to read a language strings file from the Resources folder. I highly doubt gear3.rb installed a .strings file there.
So SketchUp appears to go looking for Plugins folders in the user's home dir? I wonder if I create a Plugins folder in my HOMEPATH if SketchUp will add it to the load path?
-
sort of off topic but..
when lion is released this month, the user library is hidden by default.. pretty much anything messing with the user library is going to become more complicated to describe to other users as there's going to be an extra instruction needed to explain how to unhide it or how to find it..not sure why apple is doing that but...
[edit- but at the same time, all the more reason to have a plugin manager included in sketchup]
-
@jim said:
John,
I'm not sure why you would move it. It belongs in SketchUp's Plugins/examples folder and is loaded when the Ruby Example Scripts extension is enabled.I 'park' rubies inside there own folders to disable them [normally, colour coding the one I move]
when I parked examples.rb, I didn't, so I dragged out examplescripts.rb in error, but it worked once examples was also 'out'...@unknownuser said:
I highly doubt gear3.rb installed a .strings file there.
# This will add a separator to the menu, but only once add_separator_to_menu($exStrings.GetString("Draw"))
gear3.rb has this at the end, would that cause the string error? and why would examples.rb fix it? it does...
@unknownuser said:
I wonder if I create a Plugins folder in my HOMEPATH if SketchUp will add it to the load path?
more than likely, something use to make that folder up until v5 or v6...
john
-
The file
examples.rb
hasrequire 'LangHandler.rb'
If it doesn't load then those methods aren't there forgear3.rb
which [stupidly] doesn't 'require' all of the methods it needs...
So addrequire 'LangHandler.rb'
after therequire 'sketchup.rb'
in that file and you'll get no more errors... -
cheers TIG,
i use gear3 for quick tests, when I'm sick of cubes...
john
-
@unknownuser said:
sort of off topic but..
when lion is released this month, the user library is hidden by default.. pretty much anything messing with the user library is going to become more complicated to describe to other users as there's going to be an extra instruction needed to explain how to unhide it or how to find it..Well.. not really off topic... this has become a continuation of anothor thread (also started by Jim I think, titled something like, "Where to store user files" or similar.)
In that thread I explained that Windows has hidden (maybe since Win95?) the user's %AppData% path. I can see it because I always go into the File Settings and set show all files types and file extensions. (What can I say... geeky as charged.)
Weird that OSX gets more like Windows.. and Windows is now built upon a Linux core.
Advertisement