0

My machine is using Rails 5. Because some business, I must create new rails 4 application. I have using following syntax for generating rails 4 app:

rails _4.2.3_ new demoapp

Nevertheless, new application structure is built for rails 5. My question is: how can I use rails 5 for generating rails 4 structure app.

Thanks

Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107
  • This is not an answer to your question per se, but here is bare bones skeleton app of rails 4.1 which you could just git pull to your computer https://github.com/ianwdunlop/rails-skeleton – Eyeslandic Jan 31 '17 at 14:01
  • 1
    Did you install rails 4 gem first? `gem install rails -v 4.2.3` – Ricky Brown Mar 15 '17 at 06:49

1 Answers1

0

First of all try to find out if you have that version installed. In this case, run this command:

gem list rails

You should see the list of gems you have installed on your computer that contains the word 'rails' in the name and also you will see the version (or versions) of that gems that you have installed.

Find where does it says rails and there you will find all the versions you have installed, in my case it is: rails (5.2.0, 5.1.6, 5.1.4, 5.1.3, 5.1.2, 5.1.1, 5.0.6, 5.0.3, 5.0.1, 5.0.0.1, 4.2.0)

So I can run the command rails _4.2.0_ new myapp and it will create a new app using rails 4.2.0.

If you don't have that version installed just run the command gem install rails -v 4.2.3

And there you have it.

References:

javierojeda
  • 299
  • 1
  • 5
  • 18