Setting up a Ruby on Rails Project
Nashmeyah
Posted on April 19, 2021
Before setting up a Ruby on Rails project, you have to make sure that you have the latest version installed on your machine. If you have Ruby installed, check the version by typing
ruby -v
// then type
gem --version
If you get an error that means you don't have Ruby, download the installation package from https://rubyinstaller.org/. Follow the link and then run the installer.
Now that's done, its time to set up the Rails installation,
gem install rails
Create a new repo on GitHub. Clone the repo in your command line, within the directory you want to type this line of code,
rails new *name of your app or project*
// ex: rails new myProject
Now after you open your vscode, you can start the rails server to see your work live with the command
rails server // or rails s
Optional
The above steps set you up with blank files and folders so you can start building from scratch. But, there is an option where you can scaffold folders and files for an already setup MVC structure with a database as well.
rails generate scaffold Project name:string
That's it! Youre all set up with the bare bones of a Ruby on Rails application. Let me know if there are any other clarifications you would like me to go over! Enjoy!
Posted on April 19, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.