【发布时间】:2021-02-08 23:24:45
【问题描述】:
我重温了一个 2 个月没有动过的 Rails 4.2.11.1 应用程序。该应用程序使用 CircleCI 进行部署。之前,当触发构建时,没有任何问题。在这两个月里,代码没有发生任何变化。触发构建并运行bundle install --deployment --path vendor/bundle时,返回以下错误:
#!/bin/bash -eo pipefail
bundle install --deployment --path vendor/bundle
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
/gems/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:152: warning: constant Gem::ConfigMap is deprecated
Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Installing rake 12.3.3
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/rake-12.3.3.gem":String
Installing CFPropertyList 2.3.6
NoMethodError: undefined method `dir_mode=' for #<String:0x007f3a884a9100>
Installing i18n 0.8.6
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/i18n-0.8.6.gem":String
Installing minitest 5.14.3
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/minitest-5.14.3.gem":String
Installing thread_safe 0.3.6
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/thread_safe-0.3.6.gem":String
Installing builder 3.2.4
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/builder-3.2.4.gem":String
Installing erubis 2.7.0
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/erubis-2.7.0.gem":String
Installing mini_portile2 2.4.0
NoMethodError: undefined method `dir_mode=' for #<String:0x007f3aa040ce78>
Installing crass 1.0.6
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/crass-1.0.6.gem":String
Installing rack 1.6.13
NoMethodError: undefined method `dir_mode=' for "/root/repo/vendor/bundle/ruby/2.3.0/cache/zonebie-0.6.1.gem":String
An error occurred while installing rake (12.3.3), and Bundler cannot continue.
Make sure that `gem install rake -v '12.3.3'` succeeds before bundling.
Exited with code exit status 5
CircleCI received exit code 5
我不知道是什么导致了NoMethodError 的问题。 Trieg 搜索 dir_mode= 方法但无济于事。我真的很感激任何关于如何摆脱这个问题的提示。提前致谢!
【问题讨论】:
标签: ruby-on-rails geometry rubygems bundler