繁体   English   中英

将 rails 5.0 升级到 rails 6.0.1 - 现有应用

[英]Upgrading rails 5.0 to rails 6.0.1 - existing app

我最近尝试更新到 Rails 6,但它似乎不起作用。 我从 5.0 开始在我的 gemfile 中切换它并根据需要更新 gemfile.lock。

Step1: bundle update rails

包执行成功然后我执行命令:

Step2: rails app:update

对于多个文件选项,我得到:

/config/boot.rb? (enter "h" for help) [Ynaqdhm] n

config/boot.rb 冲突,我每次都选择“n”。

我收到如下错误:

create  bin/yarn
remove  bin/yarn
rails  active_storage:update
#<Thread:0x00007fde6d251b30@/Users/bbhushan/.rvm/gems/ruby-2.5.7/gems/thread-inheritable_attributes-2.0.0/lib/thread/inheritable_attributes.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
    2: from /Users/bbhushan/.rvm/gems/ruby-2.5.7/gems/thread-inheritable_attributes-2.0.0/lib/thread/inheritable_attributes.rb:12:in `block in initialize'
    1: from /Users/bbhushan/.rvm/gems/ruby-2.5.7/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:339:in `block in spawn_thread'
/Users/bbhushan/.rvm/gems/ruby-2.5.7/gems/activerecord-6.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:339:in `sleep': can't convert Array into time interval (TypeError)
rails aborted!
NameError: wrong constant name [[:error, ["detected unsupported rails version 6.0.1"], nil]]

我无法修复它,请帮助。

第一个问题是 Rails 不正式支持从 5.0 升级到 6.0。 您首先需要升级到 5.1,然后升级到 5.2,最后升级到 6.0。

另一个问题在这里:

config/boot.rb 冲突,我每次都选择“n”。

您需要选择 'y' 将 Rails 内部文件切换到 6.0 版本。

注意:这可能会覆盖您之前所做的修改,因此我建议您在版本控制系统中查看这些更改。

暂无
暂无

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

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