使用Google为Google App Engine Ruby 2.5标准环境提供的默认app.yaml配置,使用Rails时我无法成功部署。如果我在本地使用Ruby 2.5.5,并且在我的.ruby-version
和Gemfile
中使用Ruby,则部署失败,并显示以下信息:
Your Ruby version is 2.5.7,but your Gemfile specified 2.5.5.
如果我在自己的Gemfile
和.ruby-version
文件中本地使用Ruby 2.5.7,则部署成功,但是访问该应用程序会在日志中导致以下错误:
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
和其他重要的点文件,这些点文件在应用程序引擎默认情况下会被忽略。
非常困难!
您可以使用以下存储库复制我的构建:https://github.com/sam0x17/ruby_standard_environment_version_issue