Skip to main content

Command Palette

Search for a command to run...

How to generate a new rails app with a specific Rails version

Published
2 min read
How to generate a new rails app with a specific Rails version
A

I'm a passionate software developer.


Introduction


Goal

My goal is to create a new app with the 5.2 Rails version.


Make sure you have Ruby installed

rbenv versions
ruby -v


Check the current installed Rails versions

gem list rails --local

Output

If you get nothing, it's because there's no Rails version associated with your current Ruby version.


List valid Rails versions

gem search '^rails$' --all

Output


Install the desired Rails version

gem install rails -v '5.2' -V --no-document

Output


Check the current installed Rails versions

gem list rails --local

Output


Double check the version

rails -v

Output


Rehash the directory

rbenv rehash

Output


Create the app

rails _5.2.0_ new myapp-backend --api

Output


Check the new app

cd app_name


Done


Celebrate

The It Crowd Birthday GIFs | Tenor


Reach me out


Final thoughts

Thank you for taking the time to read our article.

If you have any questions, thoughts, suggestions, or corrections, please feel free to share them with us.

Your feedback is valuable, and we eagerly anticipate hearing from you.

Don't hesitate to suggest topics for future blog articles. Until next time!

More from this blog

Alexandre Calaça's Blog

265 posts

I'm a passionate software engineer with a deep love for turning complex problems into elegant solutions through code.