使用Google为Google App Engine Ruby 2.5标准环境提供的默认app.yaml配置,使用Rails时无法成功部署。如果我在本地使用 Ruby 2.5.5,并且在我的.ruby-version
andGemfile
中,部署失败并显示:
Your Ruby version is 2.5.7, but your Gemfile specified 2.5.5.
如果我在本地和我的文件中使用 Ruby 2.5.7 Gemfile
,.ruby-version
则部署成功,但访问该应用程序会导致日志中出现以下错误:
bundler: failed to load command: rails (/srv/vendor/bundle/ruby/2.5.0/bin/rails)
Bundler::RubyVersionMismatch: Your Ruby version is 2.5.5, but your Gemfile specified 2.5.7
请注意,我已正确设置.gcloudignore
包含.ruby-version
和其他重要的点文件,这些点文件默认被应用引擎忽略。
相当的困境!
您可以使用此 repo 重现我的构建:https ://github.com/sam0x17/ruby_standard_environment_version_issue