English 中文(简体)
Rails-从3.0迁移到3.1
原标题:Rails - migrating from 3.0 to 3.1

我想通过从3迁移到3.1来帮助一个开源项目

但我以前从未迁移过大型项目,所以我正在寻找一些建议?

这就是项目-https://github.com/locomotivecms/engine

谢谢,亚历克斯

最佳回答

在这里,它是一个“几乎可以工作”的momotivecms代码,在轨道3.1上迁移:

https://github.com/lgs/engine/tree/rails-3.1

…它还没有准备好接受拉取请求,

infact it miss to replace /images/ whith /assets/ in all the relative path ..., anyway it start and stay up (despite many "DEPRECATION WARNING"), on rails 3.1 server:

lsoave@ubuntu:~/rails/github/engine$ rails s
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)
=> Booting WEBrick
=> Rails 3.1.0.rc4 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-06-22 01:54:34] INFO  WEBrick 1.3.1
[2011-06-22 01:54:34] INFO  ruby 1.9.2 (2010-12-25) [i686-linux]
[2011-06-22 01:54:34] INFO  WEBrick::HTTPServer#start: pid=2948 port=3000

Rails控制台也运行良好:

lsoave@ubuntu:~/rails/github/engine$ rails c
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)
DEPRECATION WARNING: class_inheritable_attribute is deprecated, please use class_attribute method instead. Notice their behavior are slightly different, so refer to class_attribute documentation first. (called from <top (required)> at /home/lsoave/rails/github/engine/config/application.rb:9)

Loading development environment (Rails 3.1.0.rc4)
ruby-1.9.2-p136 :001 > 

这是我在尝试过程中遵循的指南:

问题回答

从GitHub重新发布:

It looks like the new sessions in 3.1 require 4 params: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb Line 61

def set_session(env、sid、session_data、options)

The store in locomotive only takes three: https://github.com/lgs/engine/blob/rails-3.1/lib/locomotive/session_store.rb Line 31 def set_session(env, sid, session_data)

看起来选项也在通过,这是我们没有预料到的。





相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...

热门标签