Rails-从3.0迁移到3.1



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

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

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

谢谢,Alex

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

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

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

事实上,它错过了在所有相对路径中替换/images/whith/assets/。。。,不管怎样,它启动并保持运行(尽管有很多"降级警告"),在rails 3.1服务器上:

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 > 

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

  • http://davidjrice.co.uk/2011/05/25/how-to-upgrade-a-rails-application-to-version-3-1-0.html

    更新:"无法修改SafeBuffer"错误已解决

    6月23日更新11:resolved"ArgumentError(错误的参数数量(3的4个))"将选项param(第四个)添加到lib/contromp/session_store.rb b/lib/controps/session_store.rb感谢Nicholas Hubbard之前的回答。

从GitHub:重新发布

3.1中的新会话似乎需要4个参数:https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb61号线

def set_session(env、sid、session_data、options)

机车上的商店只需要三个:https://github.com/lgs/engine/blob/rails-3.1/lib/locomotive/session_store.rb第31行def set_session(env,sid,session_data)

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

相关内容

  • 没有找到相关文章

最新更新