TextMate, chruby, and Ruby gems
I recently moved to a new iMac and did a clean install. Consequently not everything works like it did on my MBP. I made several changes suggested by @awsmsce and have incorporated that into the following. Still have the problem.
A ruby script that uses the gem mini_exiftool throws an error when run from TextMate. Here's the beginning of the script.
#!/usr/bin/env ruby require 'rubygems' require 'mini_exiftool'
LoadError: cannot load such file — mini_exiftool and
method require in kernel_require.rb at line 55
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb which possibly shows a problem. Not running the same ruby as where the gems are. But with changes recommended by @awsmsce now in
/Users/gscar/.rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb so that's not the issue
ruby -v >>
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
gem list >>
exiftool -ver >>
PATH variable is
What am I missing? With my updated info maybe the problem is how to control which ruby version TextMate runs. And the changes made per suggestions shouldn't be necessary with chruby?
RubyGems Environment: - RUBYGEMS VERSION: 18.104.22.168 - RUBY VERSION: 2.3.7 (2018-03-28 patchlevel 456) [universal.x86_64-darwin17] - INSTALLATION DIRECTORY: /Users/gscar/.gem/ruby/2.5.1/gems - USER INSTALLATION DIRECTORY: /Users/gscar/.gem/ruby/2.3.0 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby - EXECUTABLE DIRECTORY: /Users/gscar/.gem/ruby/2.5.1/gems/bin - SPEC CACHE DIRECTORY: /Users/gscar/.gem/specs - SYSTEM CONFIGURATION DIRECTORY: /Library/Ruby/Site - RUBYGEMS PLATFORMS: - ruby - universal-darwin-17 - GEM PATHS: - /Users/gscar/.gem/ruby/2.5.1/gems - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - https://rubygems.org/ - SHELL PATH: - /usr/bin - /bin - /usr/sbin - /sbin - /Users/gscar/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/bin - /Users/gscar/.rubies/ruby-2.5.1/bin - /Users/gscar/.rubies/ruby-2.5.1/shims - /usr/local/bin - /usr/texbin - /opt/local/bin Gem.path: ["/Users/gscar/.gem/ruby/2.5.1/gems"]
Answer may be here https://github.com/postmodern/chruby/wiki/TextMate, but I don't understand what or where the shim is.
Okay, I think I have it now. Gonna take a swing:
set your PATH to the following:
set your TM_RUBY variable to:
I think you currently have ruby added to the path, but not the binaries or shims.
If this isn't working, try
puts Gem.path, and make sure it points to the right location.
Make sure the gem you are trying to call is where you expect it
gem which mini_exiftool
If they are wrong, you might need to set these
export GEM_HOME=[WHATEVER YOUR GEM DIR IS] export GEM_PATH=[WHATEVER YOUR GEM DIR IS]