Locked lesson.
About this lesson
How to Google errors that you may receive while using Ruby on Rails.
Exercise files
Download this lesson’s related exercise files.
Error Handling.docx60 KB Error Handling - Solution.docx
59.9 KB
Quick reference
Error Handling
In this lesson I'll discuss how to Google errors that you may receive while using Ruby on Rails.
When to Use
Use this technique whenver you get an error while using Ruby on Rails.
Instructions
Whenever you get an error, the first thing to do is Google the error. You'll likely find a StackOverflow article telling you how to fix it.
Login to download
- 00:04 We've installed Ruby and Rails, we created our new project, but
- 00:08 we got this error here at the end.
- 00:09 So what's going on?
- 00:10 Well, like I said in the last video, you're always going to get errors.
- 00:13 And the trick is to kind of look through here and try and
- 00:16 figure out what's going on, and then Google it.
- 00:20 So we could come up here.
- 00:22 Up until now, everything is going smoothly, we're fetching,
- 00:25 we're installing, fetching, installing, and then boom, we get this error.
- 00:29 So what you want to do is go to that part and then just kind of start reading.
- 00:32 And look through here and we're seeing sqlite3,
- 00:38 something, something, again,
- 00:41 a bunch of sqlite3 stuff, down here sqlite3.
- 00:46 sqlite3, so something tells me there's a problem with sqlite3, right?
- 00:52 So sqlite3 is actually the little database that comes with Rails.
- 00:56 I happen to know what's going on here, because this is a common thing, but
- 00:58 I'm not going to tell you right away.
- 01:00 I want to show you, if you didn't know, how would you fix it?
- 01:03 What you're going to want to do here is, like I said, start at the top and
- 01:06 just kind of start reading through here.
- 01:07 And try to find something that you can copy.
- 01:10 Right here, it says sqlite3.h is missing, install blah, blah, blah, first.
- 01:17 Well, okay, I'm just going to go ahead and select all this and
- 01:22 click copy, and then head over to Google, and just paste all that in.
- 01:27 And you're going to likely find something called stack overflow right here, and
- 01:32 stack overflow is a great website.
- 01:33 It's going to be your best friend, especially with Rails, and
- 01:36 what it is is basically just a social media website for coders.
- 01:39 And you can go and post questions and other people will help you out.
- 01:43 And all of the past questions and answers are all listed, so
- 01:47 you can search through them.
- 01:49 Likely, somebody else already had this problem, we can search and
- 01:52 find the answer, it's really really great.
- 01:54 So I'm just kind of look through here and what I want to look for
- 01:58 usually, first is stack overflow.
- 02:00 because you're almost always is going to find your answer there, and
- 02:02 then down here, look at the dates.
- 02:04 You kind of want the most current ones, so here's one from 2012, 2013,
- 02:08 that's probably not it.
- 02:09 Here's one from 2019, now we're talking.
- 02:12 Look at this, how do I install SQLite3 while setting up Ruby on Rails?
- 02:15 That's exactly what we're doing, so this is very promising.
- 02:18 And you can just kind of come through here and they all kind of look like this.
- 02:21 This is the layout of this website and he's asking this question.
- 02:25 And you just kind of scroll down until you get answers and just kind of read.
- 02:29 And here it says Rails tries to automatically install the latest version
- 02:33 of the SQLite gem.
- 02:34 But that new version doesn't work with Rails yet, so
- 02:37 that's the problem we're having.
- 02:39 And instead, it wants us to just designate
- 02:44 an older version of SQLite3 in our gemfile.
- 02:48 Now, we don't know what a gemfile is yet, but
- 02:51 I'm going to probably show you that in the next video.
- 02:54 And it's actually really simple, but for now, this is a very minor error and our
- 02:58 project will actually work without fixing this, we'll fix it in the next video.
- 03:02 But for now, head back over to our Git Bash.
- 03:05 And we can just type in the cd command to change directory and
- 03:08 we want to go to pinteresting.
- 03:13 That's the project we just created, oops,
- 03:17 cd pinteresting, there we go, slash at the end.
- 03:22 And you can see now, if we pwd,
- 03:24 we are in fact in this directory and we're ready to go.
- 03:28 So in the next video, we'll jump in,
- 03:30 I'll show you our new project that we've just created.
- 03:33 And we'll go ahead and fix that error for
- 03:38 the final time and move on from there.
Lesson notes are only available for subscribers.