Locked lesson.
About this lesson
Create a new Ruby on Rails project, named Pinteresting.
Exercise files
Download this lesson’s related exercise files.
Create Pinteresting Project.docx59.9 KB Create Pinteresting Project - Solution.docx
57.4 KB
Quick reference
Create Pinteresting Project
In this lesson we'll create a new Ruby on Rails project, named Pinteresting.
When to Use
You should do this whenever you want to create a new Ruby on Rails project.
Instructions
To create a new Ruby on Rails project named "Pinteresting", navigate to the C directory of your computer by typing this command into the git bash terminal:
cd /c/
Once in the C directory, create a new Rails project with this command:
rails new pinteresting
Once the installation is complete, update bundler by typing this command:
gem install bundler
Login to download
- 00:05 So we've installed Ruby on Rails, we think, we're not sure yet
- 00:08 because we haven't actually fired it up and seen.
- 00:10 But that's what we're going to do in this video.
- 00:12 So go back to your Git Bash terminal, and I just opened a new terminal.
- 00:16 Pwd to see that we're actually in our users flatplanet directory.
- 00:21 Now, we actually want to be in just the c directory.
- 00:24 So head down here and type in cd to change directory, and we just want c.
- 00:29 And we could type pwd again to confirm that, and yes, we are in c.
- 00:33 So, I'm gonna go ahead and clear the screen.
- 00:35 Now, what we want to do here is create a new rails project.
- 00:39 Anytime you want to create a rails project you go through these same steps.
- 00:42 So we want to issue the command rails new and then just name our project.
- 00:48 And we're going to be creating a clone of the website pinterest so
- 00:52 I'm going to name this pinteresting, and hit Enter.
- 00:55 And you can see boom, boom, boom, it's creating all of these things.
- 00:58 And right away we get this message that says the latest bundler is 2.0.1, but
- 01:03 you're currently running 1.15.3.
- 01:06 And then it gives a little thing, it says to go ahead and
- 01:09 put in this command, to update it.
- 01:11 So we'll go ahead and do that in a minute.
- 01:12 And what's going on here is we're fetching and installing all kinds of gems.
- 01:17 And we'll talk about gems later on.
- 01:18 Gems are basically just the things that Ruby on Rails uses to add
- 01:23 third party functionality to itself and your app.
- 01:27 So we'll get into all this a lot later.
- 01:29 So this can take several minutes to complete, so I'm going to go ahead and
- 01:34 pause and we'll pick this back up as soon as it finishes.
- 01:37 It's finished doing its thing and we got an error message,
- 01:40 we'll talk about that in just a second.
- 01:41 Before we talk about that, I want to scroll back up to the very beginning here.
- 01:45 And see we got that message right here, latest bundler is 2.0.1 but
- 01:51 you're currently running 1.15.3, run this command to update it.
- 01:58 So go ahead and highlight this and right-click and click Copy.
- 02:02 And we just want to paste this command into our terminal down here.
- 02:06 So let me go down here and click Paste, and the hit Enter.
- 02:09 And this will take a second and
- 02:11 then it will install this latest version of bundler, and we can move on from there.
- 02:16 Okay, so it's done the thing, and we should be good to go.
- 02:20 So that's pretty much it, we've created a new project.
- 02:25 And it's in the c/pinteresting/ directory.
- 02:29 We'll take a look at that in just a second.
- 02:31 But before we do that,
- 02:32 I want to spend just a second talking about this error that we got.
- 02:35 It's actually pretty common to get errors when you first install Ruby on Rails,
- 02:40 and this is actually a pretty tame one.
- 02:42 We'll take a look at it in the next video and I'll show you how to fix it or
- 02:46 any error that you get really not such a big deal.
- 02:49 But just kind of keep in mind, especially with Ruby on Rails, even going forward,
- 02:53 you're going to find lots of errors.
- 02:55 And learning how to deal with those errors is kind of a really important part of Ruby
- 02:59 on Rails because, like I said, you're always going to have them.
- 03:02 And so, in the next video, we'll talk about how to fix it.
Lesson notes are only available for subscribers.