简体   繁体   中英

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', execute gem env for more information from /home/jeff/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/dependency.rb:328:in to_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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM