Jeff Happily
Jeff Happily

Reputation: 61

Create rails 4 app on rails 5 machine

I have rails 5 installed on my machine, but now I want to create a rails 4 app.
I use this code: rails 4.2.6 app_name
But these errors come out:

/home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:319:in to_specs': Could not find 'railties' (= 4.2.6) - did find: [railties-5.0.0.1] (Gem::LoadError) Checked in 'GEM_PATH=/home/jeff/.rvm/gems/ruby-2.3.0:/home/jeff/.rvm/gems/ruby-2.3.0@global', executegem envfor more information from /home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:328:into_spec' from /home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in gem' from /home/jeff/.rvm/gems/ruby-2.3.0/bin/rails:22:in' from /home/jeff/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in eval' from /home/jeff/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in'

Hope someone could help me

Upvotes: 0

Views: 93

Answers (1)

Thomas
Thomas

Reputation: 622

It looks like you are using RVM. So if I were you I would create a new gemset and install whatever version of Rails you want to work with.

For example

$ rvm gemset create new_gemset
$ rvm gemset use new_gemset
$ gem install rails -v 4.2.6

Now you should be able to create a new rails app with your rails new app_name command.

Upvotes: 0

Related Questions