将Rails 3应用降级到Rails 2 [英] Downgrading a Rails 3 App to Rails 2

查看:116
本文介绍了将Rails 3应用降级到Rails 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天遇到了一个问题.在过去的几个月中,我花了很多时间来构建一个强度很大的Rails 3应用程序,该应用程序使用我需要的每个宝石的所有最新版本.我刚刚被告知我不能使用任何新东西.我将与其他使用旧版本所有内容的项目一起添加到我的项目中.我们不能升级现有的,只能降级我的.

I've run into a problem today. I've spent the past couple of months building a fairly intensive Rails 3 App that uses all the latest versions of every gem I need. I've just been informed that I can't use anything new. I'll be adding my project in with a bunch of others which use older versions of everything. We can't upgrade the existing, we can only downgrade mine.

话虽如此,我几乎需要降级所有已完成的工作.这是我当前正在使用的列表(通过gem list):

With that said, I need to downgrade pretty much everything I've done. Here's a list of what I'm using currently (via gem list):

actionmailer(3.2.6)
actionpack(3.2.6)
activemodel(3.2.6)
activerecord(3.2.6)
activeresource(3.2.6)
activesupport(3.2.6)
竞技场(3.0.2)
awesome_print(1.0.2)
生成器(3.0.0)
捆绑器(1.1.4)
慢性(0.6.7)
咖啡轨(3.2.2)
coffee-script(2.2.0)
coffee-script-source(1.3.3)
erubis(2.7.0)
execjs(1.4.0)
git(1.2.5)
远足(1.2.1)
i18n(0.6.0)
珠宝商(1.8.4)
旅程(1.0.4)
jquery-rails(2.0.2)
json(1.7.3)
libv8(3.3.10.4 x86_64-linux)
libxml-ruby(2.3.3)
邮件(2.4.4)
MIME类型(1.19)
multi_json(1.3.6)
nokogiri(1.5.5)
多种语言(0.3.3)
机架(1.4.1)
机架缓存(1.2)
rack-ssl(1.3.2)
机架测试(0.6.1)
导轨(3.2.6)
栏杆(3.2.6)
耙(0.9.2.2)
rdoc(3.12)
roxml(3.3.1)
rubygems-bundler(1.0.3)
rvm(1.11.3.4)
萨斯(3.1.20,3.1.19)
sass-rails(3.2.5)
链轮(2.1.3)
sqlite3(1.3.6)
therubyracer(0.10.1)
雷神(0.15.4)
倾斜(1.3.3)
树梢(1.4.10)
tzinfo(0.3.33)
uglifier(1.2.6)
每当(0.7.3)

actionmailer (3.2.6)
actionpack (3.2.6)
activemodel (3.2.6)
activerecord (3.2.6)
activeresource (3.2.6)
activesupport (3.2.6)
arel (3.0.2)
awesome_print (1.0.2)
builder (3.0.0)
bundler (1.1.4)
chronic (0.6.7)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
erubis (2.7.0)
execjs (1.4.0)
git (1.2.5)
hike (1.2.1)
i18n (0.6.0)
jeweler (1.8.4)
journey (1.0.4)
jquery-rails (2.0.2)
json (1.7.3)
libv8 (3.3.10.4 x86_64-linux)
libxml-ruby (2.3.3)
mail (2.4.4)
mime-types (1.19)
multi_json (1.3.6)
nokogiri (1.5.5)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.6)
railties (3.2.6)
rake (0.9.2.2)
rdoc (3.12)
roxml (3.3.1)
rubygems-bundler (1.0.3)
rvm (1.11.3.4)
sass (3.1.20, 3.1.19)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
therubyracer (0.10.1)
thor (0.15.4)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.6)
whenever (0.7.3)

以下是允许使用的版本(某些宝石);

Here are the versions I'm allowed to use (for some gems);

activesupport(1.0.7)
activerecord(2.3.2)
actionmailer(2.3.2)
activeresource(2.3.2)
actionpack(2.3.2)
导轨(2.3.2)
耙(0.8.4)
sqlite3(1.2.1)
红宝石(1.3.1)
nokogiri(1.5.0)

activesupport (1.0.7)
activerecord (2.3.2)
actionmailer (2.3.2)
activeresource (2.3.2)
actionpack (2.3.2)
rails (2.3.2)
rake (0.8.4)
sqlite3 (1.2.1)
rubygems (1.3.1)
nokogiri (1.5.0)

如您所知,我有一些工作要做.我什至不确定我是否在使用第一个列表中的每一个宝石.实际上,我相当确定我不是.因此,我认为第1步是删除我实际上没有使用的所有宝石.

So as you can tell, I have some work to do. I'm not even sure I'm using every single gem in the first list; in fact, I'm fairly certain I'm not. So I suppose Step 1 is to remove any and all gems I'm not actually using.

一旦我这样做,执行此任务的最快/最简单/最好/最有效的方法是什么?

Once I do that, what's the fastest/easiest/best/most efficient way of going about this task?

谢谢!

推荐答案

我认为最简单的方法是创建一个新的Rails 2.3.2应用程序,并从头开始构建该应用程序,但要复制逻辑,模板和在需要的地方安装Rails 2版本的gem,并重写依赖于更新的gem或语法的部分.

I would think the easiest thing to do is to create a new Rails 2.3.2 app, and build that up from scratch, but copying over logic and templates and installing the Rails 2 version of gems where needed, and rewrite parts that depend on newer gems or syntax.

真正的问题是,为什么您不能按原样部署Rails 3应用程序?有了RVM,Rbenv和Bundler,就没有理由不能在同一服务器上部署不同版本的Rails(甚至是问题所在).

The real question is why can't you deploy your Rails 3 app the way it is? With RVM, Rbenv and Bundler, there should be no reason why you can't deploy different versions of Rails on the same server (If that is even the issue).

这篇关于将Rails 3应用降级到Rails 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆