rbenv / rbenv-each

rbenv plugin to Run a command across all installed rubies.
Creative Commons Zero v1.0 Universal
91 stars 18 forks source link

Does not actually cycle through all rubies on OSX #22

Open claco opened 8 years ago

claco commented 8 years ago

I'm working on setting up my Ruby environment using Ansible on both OSX and Fedora.

For whatever reason, rbenv each on my OSX machine appears to cycle through the available rubies, but not actually shim them in. the all plugin works just dandy, but I'd prefer each frankly.

 → rbenv versions
* system (set by /Users/claco/.rbenv/version)
  2.2.4
  2.3.0

 → rbenv each -v ruby --version
===[2.2.4]==============================================================
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

===[2.3.0]==============================================================
ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

 → rbenv all ruby --version
2.2.4>> ruby --version
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin15]

2.3.0>> ruby --version
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
claco commented 8 years ago

Possibly related: https://github.com/rbenv/rbenv/issues/121

mislav commented 8 years ago

What's the status of PATH at the time when you invoke rbenv each? Is there a version of Ruby whose bin directory is already pushed to the front of the PATH? If so, you must remove it before proceeding. The issue that you referenced is a long-standing limitation of rbenv that shelling out from one Ruby version to another is not straightforward. This would affect rbenv each, too.