Installing Libraries Used by Ruby1:58 with Jay McGavren
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
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
[MUSIC] 0:00 In previous courses, we've been working with rails in the development and 0:04 test environments. 0:08 In order to make our work publicly accessible, 0:09 we're going to need a server with the production rails environment. 0:11 Let's get Ruby and Ruby on Rails installed on our server now. 0:15 To follow along, you'll need a Linux server or virtual machine. 0:19 It should be set up with a deployment user that has full administrative access via 0:22 the sudo command. 0:26 If you don't have these, see the teacher's notes for more info. 0:28 So, first, we're going to need to install some development libraries 0:31 that are needed by Ruby and Rails. 0:34 So let's log into our server, via SSH. 0:36 We'll use our deployment account. 0:40 And the name of the server we need to connect to. 0:44 Since we're installing new software packages, 0:49 we're going to need administrative access, so we're gonna use the sudo command. 0:51 And then we're gonna use sudo to run the apt-get command to use our package 0:56 manager. 1:00 First, we're going to make sure that all it's libraries are up to date by 1:01 running the update command. 1:04 It'll ask for our sudo password. 1:07 And then it'll update it's list of available packages. 1:14 Now we need to install the actual packages we need. 1:18 So we're gonna run apt-get again, but 1:20 instead of the update sub-command, we're gonna run the install sub-command. 1:22 And I'm just gonna paste in this list of packages that we need. 1:26 It's pretty long, so you can just copy and 1:29 paste this command from the teacher's notes. 1:30 It'll ask if you want to continue with installing these packages with yes as 1:35 the default so we'll just hit enter. 1:39 And it'll download and install everything automatically. 1:44 This might take a little while. 1:46 When it returns to your system prompt, 1:52 all the packages needed by Ruby on Rails will be installed. 1:54
You need to sign up for Treehouse in order to download course files.Sign up