Which folders does SU look for gems in?
-
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?
-
@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"]
andENV["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 theGem::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 -
Thanks, I will test this and come back to post the results.
Advertisement