I have rails version 3.2.1 in my machine. The other versions installed are 3.0, 3.0.3. Whenever i run
rails new PROJECT_NAME
command ,the project gets created in version 3.2.1. I want to create the project in version 3.0.3.
What should i do?
There's nothing you need to do to manage two different Rails versions. The only thing you'll want to do is gem install rails to get the latest version and create your new project with rails new myapp . That will make sure the new project starts with Rails 5.1 (or whatever is the latest at the time).
you can create new app with older version
rails _3.0.3_ new appname
but you may get error as
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:316:in
bin_path': can't find gem railties (["3.0.3"]) with executable rails (Gem::GemNotFoundException)
from /usr/local/bin/rails:19:in
'
so
again install rails gem
sudo gem install rails -v="3.0.3"
now you can do
rails _3.0.3_ new app
it will work fine
thank you
You could use something like RVM and install the other rails versions in a different gemset. Then select the gemset with an older rails version and your rails command should be from the older version.
Alternatively you should be able to use
rails _VERSION_ new myapp
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With