Once it's done, you have a shiny new toy. It's not as shiny as the newer Ruby 2.0 stuff, but it's more familiar to most folks, like your favorite pair of socks. We'll choose a fairly modern version of the 1.9 family of Rubies. To make this apply to your current Terminal session, do this: $ source ~/.bash_profile $ echo 'eval "$(rbenv init -)"' > ~/.bash_profile If you do, then you can figure this out on your own. If you don't know what I'm talking about, you're probably fine. WARNING: If you use a shell other than bash, like zsh, you'll need a slightly different command set up the rbenv environment stuff. If you want to know what that stuff is, good for you! Go read the documentation. You need to hook up rbenv so it can do some stuff. But you can't quite use your new capabilities yet. Let's start by installing the tools: $ brew install rbenv ruby-buildĪssuming that all went to plan, you have just upgraded yourself and your Mac. Seriously, when you're done with this, you'll be like some sort of new X-Men team member, with the mutant power to install new Rubies with a thought. rbenv is a Ruby version manager that lets you change with Ruby you're currently using, and ruby-build helps you install a custom Ruby. We'll start by installing rbenv and it's ruby-build plugin. Ok, Homebrew is installed and you now have some new super powers. And you'll have harnessed the work of thousands of developers who are working in caves and darkend alcoves crafting Homebrew install packages just for you. Once you have Homebrew, your powers are much greater and you can install all sorts of stuff without ever having to invoke sudo or mess with permissions. You should get a pretty ASCII picture of your current directory structure. Once you do that, run the tree utility like this: $ tree Let's try it out by installing a helpful little utility, tree. Once that's done, your system will be all set up to use Homebrew, and its superhappyfuncommand, brew. It's not too scary, and should only take a couple of minutes. This little bit of magic will download the Homebrew install script and walk you through the install process. Open terminal and command your Mac to do your bidding with the following command: $ /bin/bash -c "$(curl -fsSL )" It makes installing all sorts of cool tools easy. Homebrew (or just brew, since that's the name of the command you'll use), is a package manager for Mac OS. But if that's the case, I'm not sure why you were trying to use Ruby in the first place. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*Ī word of warning: you will have to use Terminal to install this stuff. To make this better, we are going install a new, custom Ruby. installling Jekyll or something, by default you'll end up having to use the sudo command to do stuff, since the permission to modify the default config is not available to your user account. If you're doing stuff with Ruby on a Mac, e.g. Install a new Ruby with rbenv on Mac OS (and make yourself a superhero)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |