<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
发布于 2022-06-09 14:15:14
当您查看该文件的264-280行时,会发现以下case块:
# 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")。
除了这张支票做得不好外,它肯定已经过时了。我建议联系那个文件的维护人员看一看。
或者,您也可以尝试克隆和修复该文件,允许更新版本。但请记住,不能保证该文件将与新版本的开箱即用。需要更改文件以支持更新版本并不是不可能的。
https://stackoverflow.com/questions/72561098
复制相似问题