Wednesday, July 27, 2016

How to find out where ruby executable is installed

$ irb --simple-prompt -rrbconfig
> RbConfig::CONFIG['bindir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/bin"
> exit
~ bparanj$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
~ bparanj$ which ruby
/Users/bparanj/.rvm/rubies/ruby-2.2.3/bin/ruby
~ bparanj$

Key Ruby Directories and their RbConfig Terms

~ bparanj$ irb --simple-prompt -rrbconfig
> RbConfig::CONFIG['vendordir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/vendor_ruby"
> RbConfig::CONFIG['sitedir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby"
> RbConfig::CONFIG['archdir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/x86_64-darwin14"
> RbConfig::CONFIG['rubylibdir']
 => "/Users/bparanj/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0"

No comments:

Post a Comment