In this video we're going to install Ruby on Rails 7 and create our first Ruby on Rails 7 app,
in the previous video i installed ruby version 3. now if you want you can use ruby 2.7 or
upwards so anything above 2.7 should be fine to use ruby on rails version 7. so before we get
too deep into the list the first thing i'm going to do is just using the ruby on rails guides i'm
going to go through and make sure that we have all of the different requirements installed already so
for example i'm using ruby version manager for containing all of the libraries or all of the
gems within that one gem set so i have multiple versions of ruby running my computer but this just
makes it easy to control where everything is set up so in order to do this first of all i'm going
to in the terminal i'm going to run ruby version manager so rvm list and you'll see here that we
have got the latest um we have version 3.0.0 of ruby now that's the latest one according to
ruby version manager there are newer versions of ruby but we're going to go with this one anyway
so we can see that this is the current one i've got this loaded at the moment um the next thing
on the list is to check what version of ruby we're using so of course we've loaded this
one via rvm but i can also just say ruby and get the version like this you can see we've got 3.0.0
the next thing on the list here is the database so this is sqlite3
i think i've got sql lite 3 already installed sql sqlite okay doesn't understand that sqlite version
okay typos here already okay skill light 3 version and you see i've got 3.24.0 now i don't really use
sqlite 3 but i would normally use postgres but you can do the same for postgres i can say postgres
version so we've got 9.6.5 for postgres so we've got the database already set up um
already installed sorry don't have the database setup yet we've got the database installed
so we have ruby installed we've got our database uh installation
and another requirement here is node so let's check this out node version
version 15.14 so it says here that it should be greater than 8.16 so that should be okay uh yarn
now i'm pretty sure i've got yarn installed already from working with rail six so 1.22.17
so that should be okay clear the screen um so now the next thing to do is install ruby on rails
so i've set up a new gem set i'm using a new gem set within ruby version three so
i've got no jams installed at the moment so i'm gonna go ahead and run gem install rails
so this will pull down all of the required jams that
rails is dependent on so anything that rails requires will get installed once we do this
so 35 gems have been installed and so now we can say rails version
and we've got 7.0.1 so we've got rail 7 installed now so now let's go ahead and
create our first rails application using rail 7. so say rails new let's call this
rails 7 blog i'm not going to pass any parameters in here to customize the install or anything at
this point so you can pass in a particular database type for example if we want to use
postgres or we could disable the testing and the testing directories that get installed and
a number of other things but i've just gone with a very basic install here so a very basic new
application setup so i haven't done anything customized for this new rails app i've just
gone with the default settings so that should include sqlite 3 it should include a number of
testing files and a number of other things that by default we might not need in terms of building
something really simple but this is just all of the default stuff that gets set up when you create
a new rails app so let's have a look here next thing to do then is just to go into our folder
so i'm going to cd into this rail 7 blog clear the screen let's have a look at what files there are
so we got a gem log file as normal gem file gem lock file
most of this looks the same as the previous versions of Ruby on Rails
Just from a quick overview glance but i'm sure there's going to be a lot of new things in here
so we've got the app directory which is the same as the previous versions of Ruby
almost the same anyway you've got models views helpers mailers
channels jobs assets we have config folder which contains like database settings routes
all of that stuff and then the database folders like for your schema file database migrations
and what else we got here we've got the lib file lib directory um for modules custom modules and
things like that public directory for all our static files storage this is for active
storage so once you upload photos or documents that gets stored within this storage directory
and then we have our unit test fixtures all of that stuff within the test directory
um vendor git ignore yeah so most of the stuff is very similar in terms of ruby
on rails 5 / ruby on rails 6. Most of this stuff appears to be the same at this point
i'm sure once we dive into this much deeper there will be a lot of things are different
but i think from the outset things look very similar to how it was previously so
um if we run rail server now we should be able to see this working in our don't just clear
the screen first so if you're on rails server we should be able to see this working in our browser
so it's running puma
and we can see that this is running on port 3000 the same as it was previously so and we can see
that we've got the web page here this is like the default page once you install ruby and rails 7
so we've got Rails 7, we've got Ruby version 3 so that's the basic install of a new ruby on rail
7 application of course we could have passed in some parameters that allows us to set a different
database type or choose for example a bootstrap or a different css framework once you launch but this
just gets us up and running with the most basic version of ruby and rails 7. this is a very short
and simple video just to set up ruby on rails 7 but if you want to dive in much deeper we're
going to do videos on building applications using ruby on rails 7 so make sure to check those out
when they get released so make sure to subscribe and turn on notifications so you get updates when
i do those videos so at this point if you have encountered any problems in the earlier parts
of this video like if you don't have any of these things installed make sure to check out the guide
the ruby on rails guides and they will give you links to install node.js or install yarn so any
of those things that you are missing you can just follow the guide and install the requirements so
all in all very easy to set this up if you have been working on ruby on rails before
if this is your first time using ruby on rails then you may encounter some issues but
most of the information you need will be found within the ruby on rails guides, so make sure
to check that out. I am planning on working on a new ruby on rails course so more information
will come out on that very soon if you are new to ruby on rails make sure to check out the courses
i have available on my website i have two courses there one for learning ruby and one for learning
ruby on rails 6 now i will plan to come out with a new ruby on rail 7 version of the course in the
near future but check that one out in the meantime if you want to get up and running quickly that's
about it for this video thank you guys so much for watching and i will see you all in the next one
you