sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Mac $LOAD_PATH and Examples Scripts Extension

    Scheduled Pinned Locked Moved Developers' Forum
    8 Posts 5 Posters 333 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      Jim
      last edited by

      (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.

      1167.png

      Hi

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        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

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          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?

          Hi

          1 Reply Last reply Reply Quote 0
          • jeff hammondJ Offline
            jeff hammond
            last edited by

            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]

            dotdotdot

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              @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

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • TIGT Online
                TIG Moderator
                last edited by

                The file examples.rb has require 'LangHandler.rb'
                If it doesn't load then those methods aren't there for gear3.rb which [stupidly] doesn't 'require' all of the methods it needs...
                So add require 'LangHandler.rb' after the require 'sketchup.rb' in that file and you'll get no more errors...

                TIG

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  cheers TIG,

                  i use gear3 for quick tests, when I'm sick of cubes...

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • Dan RathbunD Offline
                    Dan Rathbun
                    last edited by

                    @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.

                    I'm not here much anymore.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement