首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails 7.0.3不受支持。使用Rails 4.1或更高版本

Rails 7.0.3不受支持。使用Rails 4.1或更高版本
EN

Stack Overflow用户
提问于 2022-06-09 13:23:46
回答 1查看 163关注 0票数 -1
代码语言:javascript
复制
<https://raw.github.com/RailsApps/rails-composer/master/composer.rb>:279:in `apply': Rails 7.0.3 is not supported. Use Rails 4.1 or newer. (StandardError)

Rails版本7.0.3 Ruby版本3.1.2

EN

回答 1

Stack Overflow用户

发布于 2022-06-09 14:15:14

当您查看该文件的264-280行时,会发现以下case块:

代码语言:javascript
复制
# this application template only supports Rails version 4.1 and newer
case Rails::VERSION::MAJOR.to_s
when "5"
  say_wizard "You are using Rails version #{Rails::VERSION::STRING}. Please report any issues."
when "3"
  say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Use Rails 4.1 or newer."
  raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Use Rails 4.1 or newer."
when "4"
  case Rails::VERSION::MINOR.to_s
  when "0"
    say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Use Rails 4.1 or newer."
    raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Use Rails 4.1 or newer."
  end
else
  say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Use Rails 4.1 or newer."
  raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Use Rails 4.1 or newer."
end

这个块只检查主要的Rails版本是否是"3""4""5"。对于所有其他版本号,它将返回您得到的错误消息,无论该数字是否较低(如"2")或更高(如"6""7")。

除了这张支票做得不好外,它肯定已经过时了。我建议联系那个文件的维护人员看一看。

或者,您也可以尝试克隆和修复该文件,允许更新版本。但请记住,不能保证该文件将与新版本的开箱即用。需要更改文件以支持更新版本并不是不可能的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72561098

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档