我的系统当前正在运行Ruby v2.1.2p95,Rails v4.1.4和RVM 1.25.28。
我有一个在Rails 3.0.9上运行的项目,想知道安装旧版本Ruby / Rails的最佳方法是什么?我需要安装旧版本的Ruby才能使用Rails 3.0.9吗?下面提供的是这个旧项目的gemfile。
source 'http://rubygems.org'
gem 'rails', '3.0.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'active_link_to'
gem 'acts-as-taggable-on', '~> 2.2.2'
gem 'annotate'
gem 'aws-s3'
gem 'dalli'
gem 'devise'
gem 'easy_roles'
gem 'geocoder'
gem 'impressionist'
gem 'jquery-rails'
gem 'kaminari'
gem 'koala'
# gem 'mysql2', '~> 0.2.6'
gem "oa-oauth", :require => "omniauth/oauth"
gem 'paperclip', '~> 2.3'
# gem 'twitter'
# gem 'twitter-text'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
group :production do
gem 'pg'
end
group :development, :test do
gem 'mysql2'
end
为该项目创建两个文件:一个.ruby-version
应2.1.2
在其中包含文件的文件,一个应在.ruby-gemset
其中包含项目名称的文件。
cd
进入目录,RVM将建立一个环境,您可以在其中运行bundle
并安装旧版本的Rails,而不会与您使用的其他版本冲突。
如果需要的话,这也将允许您降低Ruby版本。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句