Bummer! This is just a preview. You need to be signed in with a Pro account to view the entire video.
Start a free Basic trial
to watch this video
In previous courses, we've been working with Rails in the "development" and "test" environments. In order to make our work publicly accessible, we're going to need a server with a "production" Rails environment. Let's get Ruby and Ruby on Rails installed on our server. There are several Linux libraries that need to be in place before we can install Ruby. So first we'll use your system's package manager to install those.
To follow along you'll need a Linux server or virtual machine. It should be set up with a deployment user that has full administrative access via the sudo
command.
If you have a hosting service such as Amazon Web Services, Rackspace, or DigitalOcean, you can just set up a server through your account there. If you don't, visit our Linux Servers on VirtualBox workshop to learn how to run a Linux server within your current operating system on your computer (for free!).
Installing System Libraries
Before you can install Ruby, you'll need to run these two commands on your server. (The $
represents the prompt, so leave that out.)
$ sudo apt-get update
$ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev nodejs
-
0:00
[MUSIC]
-
0:04
In previous courses, we've been working with rails in the development and
-
0:08
test environments.
-
0:09
In order to make our work publicly accessible,
-
0:11
we're going to need a server with the production rails environment.
-
0:15
Let's get Ruby and Ruby on Rails installed on our server now.
-
0:19
To follow along, you'll need a Linux server or virtual machine.
-
0:22
It should be set up with a deployment user that has full administrative access via
-
0:26
the sudo command.
-
0:28
If you don't have these, see the teacher's notes for more info.
-
0:31
So, first, we're going to need to install some development libraries
-
0:34
that are needed by Ruby and Rails.
-
0:36
So let's log into our server, via SSH.
-
0:40
We'll use our deployment account.
-
0:44
And the name of the server we need to connect to.
-
0:49
Since we're installing new software packages,
-
0:51
we're going to need administrative access, so we're gonna use the sudo command.
-
0:56
And then we're gonna use sudo to run the apt-get command to use our package
-
1:00
manager.
-
1:01
First, we're going to make sure that all it's libraries are up to date by
-
1:04
running the update command.
-
1:07
It'll ask for our sudo password.
-
1:14
And then it'll update it's list of available packages.
-
1:18
Now we need to install the actual packages we need.
-
1:20
So we're gonna run apt-get again, but
-
1:22
instead of the update sub-command, we're gonna run the install sub-command.
-
1:26
And I'm just gonna paste in this list of packages that we need.
-
1:29
It's pretty long, so you can just copy and
-
1:30
paste this command from the teacher's notes.
-
1:35
It'll ask if you want to continue with installing these packages with yes as
-
1:39
the default so we'll just hit enter.
-
1:44
And it'll download and install everything automatically.
-
1:46
This might take a little while.
-
1:52
When it returns to your system prompt,
-
1:54
all the packages needed by Ruby on Rails will be installed.
You need to sign up for Treehouse in order to download course files.
Sign up