How to install Ruby on Rails on Windows 10 with PostgreSQL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hi everyone Brian Gill bank here from mere communications today I'm going to show you how to install Ruby on Rails on Windows 10 we're also going to install and run an app using Postgres SQL the first thing we need to do is ensure we've enabled the windows subsystem for Linux we can do this by simply typing turn Windows Features on or off in the search box here now that the menu is up let me just maximize this so you can have a better look now we just need to make sure that the windows subsystem for Linux which is in beta here is checked off as you can see it's already checked off in mind now we can close this and all we need to do is type bash right here and this will basically just start the run command we'll type yes to continue and it'll start downloading for the Windows Store I'll pause the video right here alright the windows subsystem for linux has been installed and i set in my default locale to canada you can set it to wherever you're from I don't think it impacts the database at all but if you want to leave it at the default that's fine as well so let me just maximize this so you can see it better I'm going to enter my user name I'm just going to put BG for Brian Gill Bank and going to enter a new password [Music] it's a real tight password again alright now we should have the full bash and Ubuntu installed let's check it out now let's close out of the command prompt and we'll type bash in the search bar again and as you can see now there's a new icon here let me just maximize that for you here the fonts a little small so I'm going to fix that as well let's change it to 18 so you can have a look or maybe 20 just so you can see it better nope looks like I didn't do it properly there let's change it to 20 click OK okay there we go I'm also going to set this pin it to my taskbar as well and the first thing we're gonna do is run sudo apt-get update now once this finishes we can begin installing Ruby on Rails all right now that we've checked for updates let's check out the version of Ubuntu that was installed on our computer we can do that by typing LS B underscore release - a and as you can see we're at the latest version of Ubuntu which is 16.04 so let's get started by clearing our screen and beginning to install Ruby the first thing I'm gonna do is just navigate to my blog post here we've already run sudo apt-get update so we don't need to do that again but we do need to install the dependencies for Ruby so I'm just gonna copy this line here and I'm gonna paste it over into bash unfortunately pasting directly into bash doesn't seem to work that well for me at least so I'm gonna do it the slow way here and now I'm just gonna click enter and it's gonna ask me if I want to proceed with this and I'm gonna say yes I'm just gonna pause the video now as this usually takes a couple of minutes to install it's not usually too long it really depends on how fast your system is all right we've finished installing the dependencies for Ruby what I'm gonna do right now as you can see is just speed up the video so we can get through this a lot quicker I'm basically just copying and pasting from the blog post itself so I don't think you'll have any issues doing this if you do just shoot me an email or comment on the video itself it seems to take a really long time to actually install Ruby for some reason I'm not sure why but it takes my computer at least 20 minutes so what we're gonna do is just pause when we get there here which is right about now I actually lied it only took about 18 minutes to install but that's a really long time I think what I'm gonna do right now is just set the global version to match what we installed which is two point four point zero and then we're gonna run Ruby - B to make sure that it's the correct version as you might think it should come out as two point four point zero and it does now let's clear our screen now we can install bundler by typing gem install bundler and clicking enter this shouldn't take too long maybe about 10 seconds or so but we'll just wait for it here the next thing we need to do is install node J s so we'll do this once this finishes right here alright here we go let's scroll down on the blog post to the node J s section and we're just gonna copy the first line here and paste it into bash it's gonna ask for our sudo password as well so we'll put that in once we click enter there we go now the install should only take about ten to fifteen seconds so we'll wait for it here all right we're done let's clear our screen and we'll copy over the second line here it'll just paste it into bash once this is done we can start installing rails all right let's clear our screen again and we'll copy the gem install over here and paste it into bash as with Ruby this is probably going to take 20 to 25 minutes so once we see this will take a while we'll pause the video all right everything's looking great Rails has been installed let's clear our screen and we'll run the rehash command I apologize for my slow typing in advance now let's check the version of rails we have installed which we know is 5.0.1 and there it is now the next thing we need to do is install the dependencies for the PG gem so let's copy this over and paste it into bash and we'll click enter and yes now hopefully this doesn't take too long but I apologize if it does maybe I should put on some background music if it does take a long time come on Oh finally here we go alright we're done let's clear our screen here and now we can install PostgreSQL but we're gonna do it on the windows side let's click on download the Installer and we're gonna select the latest version which is nine point six point two and I'm gonna select the 64-bit Windows operating system let's save it to my desktop and it's going to pause the video right now while this downloads alright we are fully downloaded let's extract this file and get started as you can see I've sped up the video again just so you can do this a lot quicker basically I'm going to accept all the defaults here we're gonna install all the files in the windows side we're gonna use port five four three two we're gonna set a default password which will be password and we're gonna set a default locale alrighty we've finished installing but let's check and see if the server is actually running let's head over to programs and we'll open PG admin again I've sped up the video just so this can go a little bit quicker should take a second to load here basically what I'm gonna do is just enter my password and look down to the bottom right and see that our server is connected enter my password and we are connected awesome all right we're almost done we just need to navigate to the windows side of our machine we need to do that because that's where we installed postgrads SQL so I'm just going to type Brian Gill Bank here which is my computer name and I'm going to navigate to the desktop I'm going to make a new directory called rails you can call it whatever you like or you can put it in your Documents folder or wherever let's CD into rails and now we can run our rails new command we're gonna do rails new app test and our database is gonna be postgrads SQL I always spell it wrong here sorry there we go and everything worked awesome let's CD into app test and we'll clear our screen and now we need to go and open sublime text let's do that now all right now that sublime is open let's add our project here and we're going to navigate to the desktop and our rails folder and select app test we're gonna head over to config and select database dot yml and what we need to do here is add our username our password and host which is localhost I highly recommend you set up a new user in Postgres SQL and select a secure password so our username here is just Postgres there we go our password is going to be password if I can never type it here and host it's gonna be localhost ok let's save this file and we'll head over to the command line again now it's time for the real test let's try and create the database we'll do that by running rake DB create if I can type it here there we go and this usually hangs for a couple seconds here ah there we go and it worked awesome now let's just run the rail server by typing rails s then just let it load for a second here okay let's head over to Chrome and go to localhost 3000 now once we type this in we should see a welcome message stating that we're on Rails and we are awesome alright thanks for checking out this tutorial
Info
Channel: Mirror Communications
Views: 12,570
Rating: 4.9736843 out of 5
Keywords: Ruby on Rails, Windows 10, Ubuntu, WSL
Id: u_JFDqax0l0
Channel Id: undefined
Length: 12min 52sec (772 seconds)
Published: Mon Apr 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.