- Mac OS 10.7 includes Ruby version 1.8.7 as standard. Not interesting for our purposes. We want Ruby 1.9.3 and Rails 3.2. To avoid interfering with the existing Ruby and Rails installation and therefore the packet management of Mac OS X, we install Ruby 1.9.3 and Rails 3.2 with RVM (Ruby Version Manager).
- This will take about 30 minutes. We will be setting up a Ruby on Rails development environment on Mac OS X 10.11 El Capitan. Older versions of OS X are mostly compatible so follow along as far as you can and then Google search for any problems you run into.
Canon printer drivers software. Updated: January 17, 2016
All of our online courses start with comprehensive instructions for getting the required software installed and set up on your own computer. For the online Rails course, that means installing Ruby and Rails. During the course, you’ll then write, refactor, and test your code directly on your own computer. That way, after the course, you’ll already be familiar with the environment where you can then start writing your own Rails apps!
This will take about 30 minutes. We will be setting up a Ruby on Rails development environment on macOS 10.14 Mojave. Older versions of OS X are mostly compatible so follow along as far as you can and then Google search for any problems you run into.
Setting up a stable Ruby and Rails environment on your Mac has never been easier. Here’s our recommended approach…
Install Ruby 2 and Rails 5
The best way we’ve found to install Ruby and Rails on a Mac is using the Ruby Version Manager (RVM). It’s a command-line tool that makes it easy to install and manage multiple independent Ruby environments on the same machine. That way, you’ll be able to easily switch back and forth between different Ruby and Rails versions.
Note that Mac OS X ships with a version of Ruby. However, it’s best not to mess around with the system-installed Ruby as it’s intended to be used by the operating system and apps installed by Apple. So we’ll use RVM to install a separate user-level Ruby environment, rather than mucking around with the system-installed Ruby.
- First, find the Terminal application (it’s under the Applications -> Utilities directory) and drag it onto your dock. You’ll end up using Terminal a lot as a Rails developer, so it’s good to have it handy. Then open a new Terminal session. You should see a new window with a cursor and a prompt that looks something like this:The default prompt includes the computer name (enoch in my case), the current working directory (tilde represents your home directory), the current user name (mike), and a trailing $ which is the prompt for input.If this is the first time you’ve seen this side of a Mac, it may seem rather intimidating. Don’t let it throw you. It’s simply a way to interact with your computer by entering commands. In fact, here comes our first command…
- RVM compiles Ruby versions from source code. To do that, RVM uses the GCC compiler and other build tools. Unfortunately, GCC isn’t installed by default on Mac OS X. GCC is only available after you’ve installed Apple’s Command Line Tools for Xcode.Check to see if you already have GCC installed by typing the following at the command prompt:If you see a version number, then you’re all set. If the
gcc
command isn’t found, you may get a dialog asking if you’d like to installApple’s Command Line Tools for Xcode. Go ahead and click'Install' to automatically download and install the Command LineTools.Otherwise, download the Command Line Tools forXcode. To access the downloads you may need to register as an Apple developer if you haven’t already done so. Once you’re onthe downloads page, search for 'command line tools' (in thesearch field on the left) and then click on the appropriate version of'Command Line Tools for Xcode'. Click on the.dmg
link to download it. Once it has finisheddownloading, simply double-click the.dmg
file and thendouble-click the enclosed.pkg
file to start the installationprocess. - Next, to install RVM from its GitHub repository (the recommended way), we need a working version of the git version control system. It may seem like overkill at this point to install a version control system. However, as you become more familiar with the Rails community you’ll find that having git installed will make things a lot easier. And it’s easy enough to install, so we may as well get it out of the way now.Check to see if you already have git installed by typing the following at the command prompt:Logic pro mac os x lion download. If you see a version number, then you’re good to go. (Git is included in Apple’s Command Line Tools.) If the
git
command isn’t found, then download the latest version of the graphical Git installer from the git-osx-installer downloads page. Once it has finished downloading, simply double-click the.dmg
file to start the installation process. - With that out of the way, install RVM by going back to your Terminal prompt and typing (or copying and pasting) the following:
- When the RVM installation is complete (it’s fairly quick), close your Terminal session and open a new Terminal session. Then confirm that RVM is being properly loaded in the new Terminal session by typingYou should see a version number with no errors.
- Now that we have RVM installed, we’re ready to install Ruby 2. To do that, typeThis will download, compile, and install Ruby into a directory managed by RVM (it’s under the
~/.rvm
directory). Initially you may see some help information displayed, followed by a prompt at the bottom of the screen. Press the spacebar to scroll through the help pages, or press ‘q’ to skip over the help and proceed with installation.Installing Ruby may take a while, so feel free to grab a refreshingbeverage or a tasty snack. - When the installation is done, close your Terminal session and open a new Terminal session. Then set Ruby 2 as the current Ruby version by typingThis also sets Ruby 2 as the default version to be used whenever you open any new Terminal sessions.
- Then verify that Ruby 2 is the current Ruby version by typing
- Now generate the core Ruby documentation by typingThis takes a little while to complete, but in the end you’ll have allthe Ruby documentation at your fingertips.
- Now we’re ready to install Rails! Rails is distributed via RubyGems: the standard Ruby package manager. When you installed Ruby, the RubyGems system came along for the ride. With RubyGems already installed, it’s easy to install Rails and its dependencies.Install Rails 5 by typingThen sit back and relax as RubyGems downloads all the Rails-related gems. After a minute or so, you should end up with a couple dozen gems installed.
- Finally, verify that Rails 5 was successfully installed by typing
Now you have the latest versions of Ruby and Rails installed!
Create An Example Rails App
Now that we have all the required software installed, let’s create yourfirst Rails app to make sure everything is working in harmony. We’llcreate a simple application for managing a list of todos.
- From a command prompt, navigate to a directory where you want the application code to live (
~/work
, for example). - Start by creating an empty Rails application called
todos
: - Download adobe cs6 full crack for mac. Change into the
todos
directory that was created in the previous step: - The application doesn’t know about todos yet, so we’ll use scaffolding to quickly generate all the code for managing a list of todos. Run the scaffold generator by typingYou’ll see Rails create a bunch of files, including a migration file for creating a database schema to store todo items in a database (SQLite3 in this case).
- Run the database migration by typing
- Then start the Rails app by typing
- Finally, point your web browser at http://localhost:3000 and you should see a page welcoming you to Rails. To start managing your todos, go to http://localhost:3000/todos.
- When you’re done, you can stop the Rails app by typing
CTRL-C
in the command prompt where you started the app.
Next Steps
That’s all there is to it! Now you have everything you need to start building your own Rails apps. And that’s exactly how we recommend you start learning Rails, by actually building something, whether it be for fun or profit.
Ruby and Rails Course Package
If you're ready to dive into developing with Ruby and Rails, there's no better set of courses to put you on a path to success than our popular Ruby and Rails Course Package. You'll come away with a solid understanding of the fundamentals of Rails, and how to put all the pieces together, so you can confidently create your first Rails app or jump right into an existing app!
What Is Ruby?
Ruby is a dynamic, object-oriented programming language that was created in 1995 by Yukihiro Matsumoto, a Japanese developer. Ruby was influenced by languages such as Smalltalk and Eiffel. Its main philosophy is aimed towards the developer’s happiness and productivity. Yukihiro wanted to present a language that’s comfortable to use, easy to understand, and that doesn’t try to surprise you. Therefore, programs in Ruby can often be read like a plain English text. For example:
redirect_to root_url unless current_user.admin?
.Main Ruby Concepts
- To start off, all major platforms support Ruby: *nix, Mac, Windows
- Ruby implements a paradigm of object-oriented programming. It has classes, methods, and modules. Nearly everything in Ruby is an object, meaning that you may write something like
5.times { puts 'hi!' }
- Ruby is a dynamically-typed language: it means that the developer doesn’t need to declare variables before using them. While this approach has some downsides (Ruby isn’t the fastest language in the world), programs become more compact and understandable
- Also, due to Ruby’s dynamic nature, it’s possible to implement metaprogramming. Basically, metaprogramming involves code that produces code, meaning that you may define new classes and methods during runtime. It’s a very powerful technique that allows writing relatively large programs with little code. Of course, with great powers comes great responsibility. Therefore, metaprogramming requires some experience and advanced knowledge of the language
- Metaprogramming, in turn, allows to create beautiful domain-specific languages built on top of Ruby. For example, RSpec, a popular solution for automated testing, is written in pure Ruby and allows to say something like
expect(user.name).to include('Jo')
. Even non-developers will easily understand what this line means!
Some Ruby Features
- Ruby has a great standard library implementing tools to send HTTP requests, parse JSON/XML/YAML, work with date/time and more
- If built-in tools are not enough for you, Ruby has a great community that produced tons of free and open source solutions. Looking for even faster JSON parser? Here you go. Need a fast web server? Go grab it. Wish to build graphical interfaces? Build it! Want to read some jokes about Chuck Norris? Not a problem either!
- Ruby’s community has also produced detailed documentation, tutorials, examples and best practices. If you ever require help, most likely you’ll get it.
Ruby is steadily evolving: New major versions of the language emerge every year. While it may not be the most popular language in the world, at least 10% of respondents said they were using it. And also, it’s one of the most top-paying languages!
It’s on Rails!
No doubt, Ruby’s popularity in recent years has been fueled by the emergence of the Ruby on Rails web framework in 2005. Ever since it has gained a lot of traction from newcomer and seasoned developers. Just like Ruby, Rails is aimed at high productivity and enables coders to create complex web applications by presenting all the necessary tools. This framework implements the MVC paradigm:
- Model manages data, logic, and rules
- View represents the data
- Controller acts as a glue between model and view. It gives commands what data to fetch and what view should present it
Rails is still very popular these days, and other web frameworks have borrowed many ideas from it.
Installing Ruby on Windows
PIK
Linux and Mac OS X have a great tool called RVM to manage Ruby versions and gems. There is an alternative for RVM (which is not supported on Windows), PIK. For more reference consult the GitHub page.
Install Ruby
There is an installer available: Ruby Installer. You will find the installers for different Ruby versions via the download section. After that you will need to install devkit. That is needed in order to build/download gems.
Mac OS X / Linux
RVM – Ruby Version Manager
RVM is the Ruby Version Manager. It is a useful tool to manage several ruby versions and their respective gems. A gem is something like a library that you include in your project like our phrase gem to use our REST API. To get a sense on how it is installed check out the official RVM website.
Next if you want to use RVM in a shell – and we highly encourage you to do so – then you need to add it to your bash_profile with the following entry:
Installing Ruby On Mac OS X or Linux
If you’re working with either Mac OS X / Linux we strongly encourage you to use RVM.
In order to use it see the section for RVM.
When you have RVM installed there are several steps to follow:
For those who did not install RVM: You can also use homebrew for this.
Note: your gems must be managed by yourself if need be. This can be a time consuming and process. However, there are a great deal of sources for this topic.
To install a Ruby version with homebrew. Note that homebrew only has some of the Ruby versions in store.
Installing the Phrase Gem
First, you need to create a project folder or go to your current working project (For first-time usage we strongly recommend some kind of testing environment where you can get familiar with the phrase gem without breaking anything)
For those using RVM: To enable RVM set the
.ruby-gemset
directory for RVM and set the Ruby version in the .ruby-version
file.Go out of your current directory and switch back to it so that RVM recognizes your current working directory. It will do so automatically. Your shell will tell you that it recognized your
.ruby-gemset
and .ruby-version
files.Download Ruby Mac
Now install the phrase gem:
For more details on the installation and usage see the README in the GitHub repository.
Download Ruby On Rails Mac Os X 10.10
Be sure to subscribe and receive all updates from the Phrase blog straight to your inbox. You’ll receive localization best practices, about cultural aspects of breaking into new markets, guides and tutorials for optimizing software translation and other industry insights and information. Don’t miss out!