Using AWS Cloud9 for Ruby on Rails Development

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Hey Phil, I've really been enjoying your youtube videos. I appreciate how they are based on your real world experience with Zonmaster, and not just another tutorial about a To-Do app or something. Up until now I've noticed that they are mostly based around writing the code, but as you know as a tech entrepreneur that is only half of the story. Have you considered making any videos around your marketing, sales, or customer service strategies for zonmaster? There seems to be a vacuum in the area of niche, bootstrapped SaaS marketing strategies and I'd be super interested to learn more about how you handle that side of things.

👍︎︎ 4 👤︎︎ u/elementboarder 📅︎︎ Sep 16 2021 🗫︎ replies
Captions
are you tired of setting up your development environment every time worrying if your machine is fast enough all that other stuff we worry about with hardware maybe i have a solution for you let's take a look [Music] hey guys phil here ruby on rails and today it's a little bit of a different one i'm not specifically talking about things um you know ruby on rails features so now a whole bunch of you are just going to leave what i am going to talk about is our development environment there's a few things that always kind of drive us crazy as developers i think and one of them for sure is setting up our environment man oh man why is something so simple so complicated we have all these things that are supposed to make it easy and replicable and all the rest of that stuff and yeah it's a pain and then the other thing is you know worrying about whether our machine is fast enough compatible and all the rest of it and you know we always buy new machines and all the rest of it so here's here's a solution that i kind of stumbled across that i'm just looking at and i'm using it for a couple of things and it's really interesting it's not that new it's kind of new to you or new to me and that is amazon's aws cloud9 now cloud9 is kind of like a vnc server you're firing up aws ec2 instance up there in the cloud and this is not a general purpose computer this is specifically for developing software so it's one thing is it provides you with an ide and an environment so what i'm going to do is i'm going to step through creating one of these and while i'm doing it i will talk as i always do and perhaps we'll some learn some things together about setting this kind of thing up and using it for ruby on rails development so let's go over and take a look at the screen so this is the home page for uh aws cloud9 and as it says aws cloud9 is a cloudblade cloud-based integration development environment that lets you run write run and debug your code with just a browser so that's kind of the cool thing about it it doesn't matter what kind of computer you have i could do this demo over on a computer i've got around the corner which is like my 2009 macbook air i tried running one of these ids and it works just fine it doesn't matter what computer you have as long as it has a browser relatively up-to-date browser so but of course you do need an internet connection and a good one so this is not for people who are you know in uh trying to develop over a mobile network you know in a developing nation and having connection problems that this isn't going to help you or if you're writing software on an airplane as i used to do back in the days when you could fly this isn't going to help you but at home with a steady and strong internet connection this is a cool solution and lets you share and is portable so let's take a look so we're going to get started with aws cloud again they're going to tell us it is in a cloud ide for writing running and debugging your code that's nice let's create an environment and we're going to call this ror test1 a simple ruby on rails dev environment let's go to the next step here we can choose what kind of thing it is we're just going to keep it on the t2 micro new ec2 instance we're going to use ubuntu or ubuntu ubuntu however you want to say it that's what we're going to use we're not going to use amazon to amazon linux or anything like that because i know ubuntu that's why and see this is the cool thing here let's zoom this in so we're going to choose ubuntu cost saving setting if you're not using it for 30 minutes or you can change that even to uh well 30 minutes i guess it's the smallest it's going to shut down it's going to hibernate the ec2 so you can essentially work for about two dollars a month i figured it out that if you run you know for five or six hours a day your development environment it's gonna cost you two dollars a month that's pretty cool and it's uh you know for something that's cloud-based backed up you know secure and safe by definition there we go we're gonna let it do that cost saving for us that way we don't have to worry about it we're going to leave the vpcs and things like that network settings and we're not going to add any tags and we're just going to go on to the next set you use this kind of stuff you can access this from outside and by that i mean like if you're running let's say your web server on here you can access it from outside you need to set up your subnets and vpcs and things like that i'm not going to do that in this demo but you can do it next step next step is to tell you what we just did in the other steps and there we go let's create the environment and while it's doing that i'll drink a little coffee and i'll tell you what's coming up so we've created the environment yeah it comes with some stuff installed but we really need to update uh certainly i think we need to update git if i if that's what happened to me i mean but it's running ubuntu 18 which of course is not the most recent ubuntu and so we're just going to update git and then we're going to install postgres i read that somebody on the internet said oh it comes default with postgres well mine didn't so uh i don't think it does maybe the linux one uh the amazon linux does i don't know and uh it's gonna take a couple of minutes i'll probably just cut this video and come back in a second oh no i'm not because it's connecting there we go now when you go away and it shuts down and hibernates this image and comes back up it does take a minute to fire it up but i mean it's not for me it's not any slower than starting up your computer so not something you have to worry about there we go this is our ide it looks an awful lot in my mind like a visual vs code so we've got a console down here now what i didn't try what's that oh we can pop it out there we go did i pop it in i know or did that full screen let's take a look i can't zoom it up so that's a bit of a drag so i hope you can see maybe i can zoom it up in the editor so let's take a look at get version here 17. we can do uh sudo apt update it's going to go off check some stuff and then we can just up upgrade we trust it oh yeah was there another there was something that i i didn't do for that yeah all right let's uh let's just move on to doing the get here we've done an update already so let's do a pseudo apt install minus y get oh it already is never mind maybe i was wrong about that we're going to uh generate a key pair here and that's just going to create an ssh key we'll see why i need that in a second because well i'll tell you why because i'm going to connect it to my github account and pull down some stuff so uh what we need now if we look is there p sql command p sql is not found so what i did was sudo apt install postgresql post grass sql common no con trib and then lib p q dev this will go off and pull down everything that we need to have on here so that we have a database on here i'm assuming that you're going to use postgres because that's what all the cool kids are using me not being cool kid i often use um mysql but we won't do a demo for that here i'm trying trying to move away from mysql after 20 years on it so it's going to go up oh my gosh it's done it that's fine uh because what we need to do is we need to set up our user this is weird when uh postgres secure postgres p sequel okay and then we're gonna set a password and we're just gonna call it one two three ruby on rails test exclamation one two three i forgot what i typed okay i'm going to just make a note of that over here uh huh stupid thing this is exciting isn't it okay i've saved my password and that's it that's all i need to do for now so let's quit postgres let's close this now what i'm gonna do we're going to cap the ssh id rsa.pub that was created and i'm going to go to my github account and probably have to blur out something here on the screen but we can just add a new ssh key and we're going to call this cloud9 and we will go over and copy it one of the things that's better about this of cloud9 than using like a vnc connection is the copy and paste it's a browser window so you can copy from your computer to this and back and forth it doesn't matter it's not anything special always copying pacing between a vnc connection never worked because the clients are you know so we're going to just paste in our thing here we go i forgot my password there we go so it's added a new cloud 9 [Music] key and so pretty much i'm done what i'm going to do now is go over to my repositories and we'll use this one good picture of me taken by my friend dave one of the few times in the my life i've worn a suit we're gonna copy the ssh key and what do we got we're in this environment folder which is what they recommend don't try and be more clever than the thing like i always say in here you are not more clever than the system just use what they want you to use so get clone that yes and because we're using our ssh key we put the key in we're good to go so now let's hide this and there it is there my friends is our thing from uh pulled down from github and we can see that all our code is in there and i'm going to show you a couple of i'll show you that it's there i mean of course you believe me why wouldn't i why would i be lying so there's the thing it's not so badly uh formatted you know and the coloring and stuff like this i can easily work on this environment i'm not one of these people who asked as a special theme with certain colors and all that we're writing software here not working for on a painting so what do we want to do next let's move into the directory i'll just on this now i'm going to go back and show you what i've said because i hide it it says that ruby 2.72 is not installed yes these things these cloud9 ide instances come with rvm installed so how cool is that so we can simply copy and paste rvm install 2.72 i could have installed 2.74 but i didn't feel like changing the gem file it's going to go off it's going to go in here's where you see how fast this machine is it's going to like i don't know how there it's done i don't know how long it takes to install a version of ruby on your machine but it takes an awful lot longer than that and i'm running a pretty recent macbook pro here so we've got 2.72 see no more warning and i believe we can say bundle i might have to install bundler let's see no bundler is installed and there it's going to go off and it's going to install all of our gems this might be a short video because these machines are so fast so we're installing all the gems you know you would do things like install the yarn i think i need to do that as well and it's just installed the postgres gem so that means the postgres is running fine and the development environments for postgres are installed as well it's this is the one thing that took a long time when i was doing the test is this sas c took a long time to install on this machine but we can spend some more time together that's the advantage of it you know it's so cool uh if i may speak personally for a minute to do these videos i'm learning a lot you know like because i think oh you know whenever i'm working throughout the week and i stumble across something i think oh you know that would be cool to do a video for the youtube channel i think you know my target market for videos is kind of beginner to middle people you know i'm not an advanced well i'm an advanced developer i guess because i'm advanced in years but i don't need all that fancy schmancy stuff so i'm just here to give you a straight poop and i think that this cloud 9 is something very cool for beginning developers despite the fact that this thing whatever it's doing takes forever and yep you might be interested to know that uh i am also developing some courses that maybe go a little more in depth so um i'm going to do a debugging rails course that goes a little bit more in-depth than the video that i've got here on youtube and i'm going to do a course on stimulus and i'm going to do a course on elastic rails so those will come out over time and those are going to be courses over on thinkific which is the kind of education platform that i'm going to be using when that's ready i will have links of course everywhere i'm going to cut the video now because it's taking forever oh it's back it's done okay done i cut the video only for like 10 seconds because i was talking so much so that's installed we're just going to do a yarn [Music] what am i doing there oh i don't need to do that so there you'd think it would work but i'm gonna do uh this bundle exec rails db setup and you'll see it doesn't work and so because the roles can't create the contractor development and so on so if we look at our database yaml it's trying to use all the defaults and stuff like that what i have discovered is that you need to have some i'm going to add the user in here so the user is actually postgresql and the password you can now see my clever password run rails test exclamation and i don't ask me what this means but there's something called templating template 0 and then finally the host by default it's going to use localhost and that for whatever reason doesn't work probably with the aws security but one two seven zero zero one does work so we're gonna put that i'm gonna put all of that in the default i'm just gonna save everything change is saved and now we're going to run it again db setup which creates the database and does the seed if there's a seed so now we can actually run it and that's running and you can see it's running on puma so let's take a look at rails c and we can do a time tracker dot new so it's creating everything let's time tracker create and [Applause] yeah because it's hitting all of the restrictions so topic test started at time.current status of running and action cable looks like it's got an issue with action cable oh cause redis of course redis is not running pseudo abt install redis there we go i believe it starts the server automatically now we need redis of course for the for stimulus and hot wire so let's create another one bing so we have a running application on cloud nine and watch this not this i mean this here i can close this now we've got some other things we can share this out show this environment we can manage the ec2 instance but yeah so if we go to mana cc2 instance it fires up and you can see we've just got a regular ec2 t2 micro and we can put this select it and we can stop the instance it will do this automatically after 30 minutes okay so it's stopped i've got my environments uh i'm gonna just refresh this window here's my environment that's it one of the cool things is because it's two dollars a month when you're using it every day you can create a whole whack of these and they cost you basically nothing so you don't need to create a one you know one machine and use it like your computer what i think is an interesting idea is you create one of these per project that you're working on so you have a very discreet containerized project and you just fire that one up and start your work and of course you know you can commit your changes into github so it's going to here we are booting up my instance again and you know i i made some changes uh i can cd into stimulus here get status i did make a change so what i would normally do we check it minus b cloud nine and so we've got we're on a new branch get status get add minus p uh i just added the stuff for the database i know you shouldn't but i'm going to check it in just to show you and uh git commit cloud9 db stuff and then we just set it in so why don't we add our email and add my name bingo commanded oh i already committed and then we can get push origin cloud9 and it will oh i shouldn't have done that because that already done before um there we go so it's put a new branch and if i go over to my um github you can see we've got a cloud9a i had already a cloud9 so there we go i think this is cool uh i like amazon services personally i don't use them for zone master for the compute part but there's a lot of cool amazon services i'm actually thinking about doing a video that goes through all of the amazon services that i think are of interest to a developer ruby on rails developer but this is certainly one of them i hope you're excited about it i hope this is something new for you and if it doesn't if it's not something you're going to use maybe it'll give you some ideas about how you use your own environment that's all for now like subscribe bell notification whatever it is people ask you to do i'm asking you to do the same thing we'll see you soon thanks for watching
Info
Channel: Phil Smy
Views: 463
Rating: undefined out of 5
Keywords: ruby on rails, learn ruby on rails, software as a service, saas business, how to create the perfect saas business, tech entrepreneurs, entrepreneur, become an entrepreneur, become an entrepreneur motivational video, be an entrepreneur, amazon web services, aws cloud9, web development
Id: CRc5p9PSFfI
Channel Id: undefined
Length: 26min 42sec (1602 seconds)
Published: Sat Sep 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.