- Goto
https://www.ruby-lang.org/en/downloads/
- Run
rubyinstaller-devkit-##.##-x64
- Open command line and run
ruby -v
// Checkout version
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [x64-mingw32]
- Open CMD
gem install rails
- Check version:
rails -v
- To check updates
gem update rails
rails new <project-name>
- Once done installing...
cd <project-name>
- Run project
rails server
- NOTE: If required
-
npm install --global yarn
-
rails webpacker:install
-
Make sure all packages are up to date
npm install --check-files
-
Start your Rails server
rails s
-
Visit
http://127.0.0.1:3000
#config/routes.rb
root "welcome#code"
#app/controllers/welcome_controller.rb
class WelcomeController < ApplicationController
def code
end
end
#app/views/welcome/code.html.erb
Hello world!