sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Which folders does SU look for gems in?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 620 Views 2 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.
    • S Offline
      sepultribe
      last edited by

      Gem;;default_dir
      C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/lib/ruby/gems/2.0.0
      Gem;;user_dir
      C;/Users/Popi/.gem/ruby/2.0.0
      Gem;;dir
      C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems
      

      Let's say someone needs to install some gems on a pc with no internet con. In which of the above folders must one place the gem files? Will it also need the spec files too? Or anything else?

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

        @sepultribe said:

        Gem;;default_dir
        > C;/Program Files (x86)/SketchUp/SketchUp 2014/Tools/lib/ruby/gems/2.0.0
        > Gem;;user_dir
        > C;/Users/Popi/.gem/ruby/2.0.0
        > Gem;;dir
        > C;/Users/Popi/AppData/Roaming/SketchUp/SketchUp 2014/SketchUp/Gems
        

        FYI the first two paths are totally incorrect, as I had told you in another thread, the SketchUp Team has not yet provided a rubygems defaults override rb script (as outlined in the comments at the top of the "rubygems.rb" file.)

        Therefore, the paths returned by most Gem class methods will be invalid.

        BUT,... the SketchUp Ruby C-side initialization routine DOES set two environment variables:
        ENV["GEM_HOME"] and ENV["GEM_PATH"]
        which are both the same, but DO DIFFER with bitness on SketchUp 2015 & higher:
        SketchUp 2014
        ENV["AppData"] + %(#800080)["/SketchUp/SketchUp 2014/SketchUp/Gems"]
        SketchUp 2015 64-bit
        ENV["AppData"] + %(#800080)["/SketchUp/SketchUp 2015/SketchUp/Gems64"]

        @sepultribe said:

        Let's say someone needs to install some gems on a pc with no internet con.

        In which of the above folders must one place the gem files?

        Actually none of the above.

        The Gem::install method will check the "cache" sub-directory of the ENV["GEM_HOME"] path for the gem archive, if it is not there, it will try to download it from the gemserver.

        You can use the Gem::install class method, OR create your own installer instance, with custom options, by calling Gem::Installer::new

        @sepultribe said:

        Will it also need the spec files too? Or anything else?

        The specification file is inside the gem archive file. It will be copied to the
        "#{ENV['GEM_HOME']}/specifications"
        sub-folder by the Gem::Installer instance that is installing the gem.

        The complete online Rubygems documentation is here:
        http://ruby-doc.org/stdlib-2.0.0/libdoc/rubygems/rdoc/index.html

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • S Offline
          sepultribe
          last edited by

          Thanks, I will test this and come back to post the results.

          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