If not, you can install it with your package manager, e.g., RPM, Yum, DPKG, etc. Ruby on Linuxĭepending on your distribution, Ruby may or may not be pre-installed on your Linux system. At that point, you will have to use a Ruby version manager or a package manager like Homebrew to install Ruby. After installing Homebrew, you can use it to install and manage lots of tools, including Ruby.Īpple intends to remove Ruby entirely from future versions of the macOS operating system. Follow the instructions on the Homebrew home page to install Homebrew on your system. On a Mac, you should install Homebrew, a package manager designed for Macs you may need this to install some programs that are useful with Ruby, like PostgreSQL. We discuss Ruby version managers in a later chapter. That's a real hardship.īetween being outdated and needing root access, the system version of Ruby on a Mac is suboptimal for development you should install a Ruby version manager and use it to install the Rubies you need (you'll see people say "Rubies" to just mean "different versions of Ruby"). Root access is a privileged user level that isn't always available to the developer, so the developer lacks the permissions needed to easily install these components. The Mac system Ruby has a characteristic that makes it undesirable for developers: it needs root access to install and manipulate other Ruby components (we'll discuss these later). As of this writing, the latest Ruby version is version 2.3.2. To check the exact version, you can ask your system Ruby for its version number. However, the installation is usually an older version of Ruby. Your system Ruby is a complete installation of Ruby and its standard components. You can find the ruby command at /usr/bin/ruby. On Macs, Ruby is part of the standard OS X/macOS installation. However, keep in mind that there may be some minor discrepancies don't worry if there are some slight differences in outputs. You can use whatever version of Ruby that you find convenient the most recent release is preferable in most cases. Throughout the book, we use some variant of version 2.3 or version 2.2, both of which are now obsolete. It's not practical to keep this book completely up-to-date with the latest version of Ruby. If you go this route, you can skip the following sections on installing Ruby version managers. This protects you from the problems that can arise when you misuse root privileges.Ĭloud9 is the path of least resistance for people who aren't comfortable managing system tools and libraries we recommend it if you have never installed or configured system tools. With RVM, you can install and manage Ruby components without root privileges. For instance, you don't have to install RVM yourself. The pre-installed RVM removes several potential stumbling blocks from your path to Ruby enlightenment. Most notably, it automatically installs the RVM Ruby version manager, and sets things up so that RVM controls which Ruby you use, not the system. Specifically, the workspace for Ruby projects includes several items seldom found in a default system Ruby. They take things a bit further, though, and install additional software that almost every Rubyist needs. Ruby on Cloud9Ĭloud9 uses pre-built workspaces based on standard Linux distributions. In this chapter, we'll discuss how Ruby gets on your system, and how to determine which Ruby version you are using. There may also be some usage restrictions that make it hard to use. However, this will likely be an older version of Ruby lacking the most recent features. For instance, on a Mac, you can use the Ruby version supplied by Apple as part of OS X or macOS. You should understand how Ruby got on your system (this means either the physical computer you're using, or if you're using a cloud-based development environment, like Cloud9, their development environment), and how to determine the version of Ruby your system uses. If not, the package manager supplied by your system can install it in just a few minutes. Fortunately, your system probably came with Ruby pre-installed. Before you can begin using Ruby to develop software, your development environment must have Ruby installed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |