我想通过从3迁移到3.1来帮助开源项目
但我之前从未有过迁移大型项目所以我正在寻找一些建议吗?
这是项目 - https://github.com/locomotivecms/engine
谢谢,Alex
答案 0 :(得分:1)
这里是一个“几乎正常工作”的locomotivecms代码,迁移到rails 3.1:
https://github.com/lgs/engine/tree/rails-3.1
......还没有为拉请求做好准备,
实际上它错过了在所有相对路径中替换/ images / whith / assets / ... 无论如何,它开始并熬夜(尽管许多“DEPRECATION WARNING”),在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”错误已解决
更新jun 23 11: 解决了“ArgumentError(错误的参数数量(4 for 3))”将选项param(第四个)添加到set_session到lib / locomotive / session_store.rb b / lib / locomotive / session_store.rb 感谢Nicholas Hubbard先前的回答。
答案 1 :(得分:1)
从GitHub重新发布:
看起来3.1中的新会话需要4个参数: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb第61行
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)
看起来我们没有想到也会传递选项。