Your system Ruby needs to stay as it is as you probably want to avoid finding out that it was sacrosanct the hard way. I'd recommend removing the Homebrew installed instance of Ruby, install either RVM or rbenv, and then allow that "sandbox manager" to handle your Rubies. I've used them both and they work extremely well. From here, double-click the Terminal application to open it up. Like any other application, you can find it by going into Finder, navigating to the Applications folder, and then into the Utilities folder. RVM and rbenv are two such tools commonly used in the Ruby world to handle this. Step 1 Using the macOS Terminal To access the command line interface on your Mac, you’ll use the Terminal application provided by macOS. So, some enterprising, really-smart, people figured out we could manipulate our PATH setting, store our Rubies in a different location, typically our home directory, and then write code that can manage which version we want to use. But, inevitably we'd mess up, type the wrong "ruby" and break something. To fix that we'd end up tacking on version numbers, like ruby193 or ruby2.2 to multiple instances in /usr/local/bin and then write scripts with #! lines pointing to the appropriate version. HOMEBREWINSTALLFROMAPI is a new opt-in flag to install formulae and casks in homebrew/core and homebrew/cask taps using Homebrew’s API instead of needing the (large, slow) local checkouts of these repositories. The downside to this is that we're only able to have two versions of ruby. Monterey ships with Ruby 2.6.8 so we’ve released and use Portable Ruby 2.6.8. Tools that need the originals still know to look in /usr/bin. That allows us to add overrides to commands if we want, again by putting them in the /usr/local/bin directory. Typically it'll have "/usr/local/bin:/usr/bin" so that the OS will search in the "local" repository of executables before it'll look in the "system" repository. Our PATH environment variable defines the search path to find things. "local" implies it's for the "local" user's use, not for the system's use. If the user decides to install another version, perhaps because it's more recent, and it's for their use, not for the system's, it'll go into /usr/local/bin/ruby. We can use that, but we shouldn't alter/update/delete it because those tools would break, possibly with spectacular results. That version will be used by system-installed Ruby-centric scripts. By default the ruby executable will be found in /usr/bin/ruby. It's possible to have multiple instances of a language installed on a system. my Travis CI tools (and the version of Ruby it uses)?.Why does the "system" Ruby that Homebrew sees not agree with the version that my system uses at the prompt? How do I keep all this up-to-date? Specifically, how do I keep up-to-date Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.4.1_1/bin/rubyīut when I ask my system I get: $ which -a ruby When I ask Homebrew I get: $ brew -config I'd like to keep both of those current, but I'm confused right off the block by what version of Ruby I'm even using. Windows users should use Ruby Version Manager, a Ruby version manager that is compatible with. I'm not a Ruby user per se, but have it on my system because I use it (so far) for just two things (that I'm aware of): ruby-install and chruby are not available for Windows users.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |