简体   繁体   English

如何使用JRuby将Rails 2.3.12升级到3.x或4.x版本

[英]How to upgrade rails 2.3.12 to 3.x or 4.x versions using JRuby

I used Jruby version 1.6.5.1 which include Ruby 1.8.7, rails 2.3.12. 我使用了Jruby版本1.6.5.1,其中包括Ruby 1.8.7,rails 2.3.12。 and gem 1.6.2. 和宝石1.6.2。 How can I upgrade all this versions to higher versions (Jruby 1.7.x, ruby 1.9.x or 2.x and rails 3.x or 4.x) 如何将所有这些版本升级到更高版本(Jruby 1.7.x,ruby 1.9.x或2.x以及rails 3.x或4.x)

Thanks in advance. 提前致谢。

You can use rvm to manager ruby version 您可以使用rvm管理ruby版本

Bellow code lines is use install ruby 1.9.3 on Centos. 波纹管代码行是在Centos上使用install ruby 1.9.3 You can refference it. 您可以参考它。

curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh

rvm install 1.9.3

rvm use 1.9.3 --default 

this will be a multi-step process and largely depends on the gems you're using. 这将是一个多步骤的过程,并且在很大程度上取决于您所使用的宝石。 it really helps if you happen to have test coverage, otherwise it might get a little painful. 如果您碰巧拥有测试覆盖率,这确实会有所帮助,否则可能会有些痛苦。

here's shortly what I would do (did some 2.3 upgrades previously) : 这是我不久要做的(以前做了2.3升级):

  • upgrade JRuby to latest 1.7.x it defaults to 1.9.3 but using --1.8 makes it 1.8.7 compatible 将JRuby升级到最新的1.7.x,默认为1.9.3,但使用--1.8使其与1.8.7兼容
  • setup Bundler on Rails 2.3 http://bundler.io/v1.11/rails23.html (will help managing the gems) 在Rails 2.3上设置Bundler http://bundler.io/v1.11/rails23.html (将有助于管理gem)
  • attempt to upgrade to Rails 3.2 (review an empty created app to adjust the environment/*.rb, environment.rb, boot.rb etc. accordingly) - some gems might need an upgrade or replacing 尝试升级到Rails 3.2(查看一个空的应用程序来相应地调整环境/*.rb、environment.rb、boot.rb等)-一些宝石可能需要升级或更换
  • switch off the --1.8 switch for JRuby ... you'll be running with 1.9.3 关闭JRuby的--1.8开关...您将以1.9.3运行
  • (optional) upgrade to Rails 4.x (可选)升级到Rails 4.x
  • (optional) upgrade to JRuby 9.0.x (可选)升级到JRuby 9.0.x

*each step assumes running tests or somehow testing out the app is in a working state. *每个步骤均假设正在运行测试或以某种方式测试应用程序是否处于工作状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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