pguardiario
pguardiario

Reputation: 54984

refer to gem's install folder

I want to bundle ca certs with my gem to avoid ssh connection issues. How would I refer to my gem's install folder. In other words I want to do:

ENV['SSL_FILE'] = "#{install_dir}/ssl/cacert.pem"

How would I get install_dir?

Upvotes: 0

Views: 385

Answers (1)

Kashyap
Kashyap

Reputation: 4796

Gem.dir

From the command-line, this command will print out the options for the environment on your computer:

$ gem environment

and this is the source code: Gem::Commands::EnvironmentCommand Check out the rest of the variables under the #execute method. If in case you need to use older rubies, require rubygems explicitly to get access to that command.

Upvotes: 1

Related Questions