But why? This is a golden opportunity to be “Standing on the shoulders of giants”? Meaning, we can use stuff that other people have built, so we don’t have to redo the hard work. When developing something in ruby you can always write everything from scratch. Long story short: we want to keep everything up to date, mainly for security (better safe than sorry!) but sometimes also to access new features that have just been released. Let’s take a closer look at how they work together and how we interact with them. Then, since we are using ruby and gems we need bundle to keep track of all of them for a specific project. We use rbenv to install new versions of ruby on your computer (or run many different versions in parallel). So we need brew to be able to install rbenv. bundle - a package manager for ruby to keep track of your gems (for a specific project).gem - confusing name for a ruby package.ruby - the program language of our choice today.brew - package manager for macOS and linux code.But you will soon learn how complicated it would be if we didn’t have brew, rbenv and bundler) To summarize (If you think this sounds very complicated, you are not alone. It is called Bundler, or bundle for short. ![]() It doesn’t stop there… Very much like we use brew to help us keep track of different macOS/linux packages ruby itself also has a package manager for its gems. To complicate things further, these ruby packages are not called packages. This is great since it allows you as a developer to reuse other developer’s code and not reinvent the wheel every time you build something. Ruby and it’s environment also provides a subset of packages that is open source and distributed. And it allows you to install and run multiple versions of ruby at the same time. It makes it easier to install new versions of ruby. It helps you to contain ruby and gems to one location on your computer. ![]() ![]() You could survive by using the ruby version that comes with macOS and update it as soon as new versions come out, but using rbenv has many advantages. Ruby Version Manager, more commonly known as RVM or rbenv is exactly what it sounds like: a version manager for ruby. Most pressingly, it’s complicated to install and update packages yourself. You could run ruby without it, in fact - ruby comes preinstalled with macOS. One of the most used package managers for macOS and linux is called Homebrew, or brew for short. “A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer’s operating system in a consistent manner.” How would Wikipedia describe a package manager? To help us, we need a package manager… Brew - our package manager of choice Because we are power users (wieehoo! Right?). Most users of macOS are happy with applications they can download from the internet or purchase via the App Store. They are of interest if you are a developer, or so called “power user”. A normal user rarely comes in contact with these applications/ packages since they are mainly acessible via the terminal or runs in the background. Its job is to keep track of the latest versions of these packages and distribute it in a more controlled fashion. That is the purpose of a “package manager”. And because they are open source and freely distributed, as counterintuitive as it might sound, we need to centralize it somehow. ![]() They either come pre installed or can be installed through something called a “package manager”. Some applications are called packages or libraries (libs). Unix and Linux are open source and developed by thousands of developers. Open source means that anyone can freely review the code, make changes or write new applications. And they all have two things in common, they are composed of several components packed together - open sourced and distributed. Without going into too much detail it is based on another, more primitive operating system called Unix. Your computer runs an operating system called macOS. We will start with a brief history lesson followed by further explanation of included parts. An explanation to the intricate relationships between your mac computer and required packages to run ruby in an optimal way.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |