Ruby on rails 运行“gem update--system”后,将gem打包到vendor/cache/ruby/<;版本>;

Ruby on rails 运行“gem update--system”后,将gem打包到vendor/cache/ruby/<;版本>;,ruby-on-rails,ruby,rubygems,Ruby On Rails,Ruby,Rubygems,当我试图找出TravisCI上的捆绑问题时,我意外地跑了 gem update --system 在我的Mac电脑上。这更新了很多东西,但我不知道具体是什么,因为我没有保存输出。这样做之后,在我的Rails应用程序中,我注意到当我运行bundle install--local时,它开始将gems安装并打包到vendor/cache/ruby/中,而不是使用vendor/cache中的gems bundler中的路径设置为vendor/cache,但其他一些设置导致它将gems绑定到ruby版本

当我试图找出TravisCI上的捆绑问题时,我意外地跑了

gem update --system
在我的Mac电脑上。这更新了很多东西,但我不知道具体是什么,因为我没有保存输出。这样做之后,在我的Rails应用程序中,我注意到当我运行
bundle install--local
时,它开始将gems安装并打包到
vendor/cache/ruby/
中,而不是使用
vendor/cache
中的gems

bundler中的路径设置为
vendor/cache
,但其他一些设置导致它将gems绑定到ruby版本目录下。是否有人知道该设置可能是什么,或者我如何修复Bundler,使其使用
供应商/缓存中的gems

宝石版

bundler - 2.1.2 (2019-12-20 commit 4da3289eb)
rubygems - 3.1.2
绑定器配置

$ bundle config
Settings are listed in order of priority. The top value will be used.
build.libv8
Set for the current user (/Users/me/.bundle/config): "--with-system-v8"

cache_all
Set for your local app (/Users/me/forem/.bundle/config): true
Set for the current user (/Users/me/.bundle/config): true

jobs
Set for the current user (/Users/me/.bundle/config): 3

path
Set for the current user (/Users/me/.bundle/config): "vendor/cache"

让我知道如果任何其他信息将是有益的

好了,各位,这就是问题所在

布勒解释道

  • 路径(BUNDLE_path)-磁盘上的位置,无论$GEM_HOME或$GEM_path值如何,BUNDLE中的所有GEM都将位于该位置。在此位置未找到的Bundle gems将由Bundle install安装。默认为Gem.dir。使用--deployment时,默认为vendor/bundle
  • cache\u path(BUNDLE\u cache\u path)-bundler在运行时将缓存的gem放入的目录
  • 问题 我将BUNDLE\u路径设置为“供应商/缓存”。这导致Bundler尝试在“vendor/cache/ruby/”中安装所有gem,而
    .gitignore
    不会忽略这些gem,因此导致了大量的dif

    解决方案:
    将BUNDLE\u路径重置回默认的“供应商/捆绑包”

    好,问题就出在这里

    布勒解释道

  • 路径(BUNDLE_path)-磁盘上的位置,无论$GEM_HOME或$GEM_path值如何,BUNDLE中的所有GEM都将位于该位置。在此位置未找到的Bundle gems将由Bundle install安装。默认为Gem.dir。使用--deployment时,默认为vendor/bundle
  • cache\u path(BUNDLE\u cache\u path)-bundler在运行时将缓存的gem放入的目录
  • 问题 我将BUNDLE\u路径设置为“供应商/缓存”。这导致Bundler尝试在“vendor/cache/ruby/”中安装所有gem,而
    .gitignore
    不会忽略这些gem,因此导致了大量的dif

    解决方案:
    将BUNDLE\u路径重置回默认的“vendor/BUNDLE”

    项目文件夹中是否有“.BUNDLE”目录?如果是,请在“.bundle/config”中编辑路径并尝试安装。不确定是否适合您的情况。
    Gemfile.lock
    是否已更改?@benjessop有一个.bundle目录,我尝试在其中设置路径,但没有成功。BUNDLE_路径:“vendor/cache”@Kache Gemfile.lock一点也没有改变,我在我们的主分支()上,只是尝试运行应用程序。您的项目文件夹中是否有“.BUNDLE”目录?如果是,请在“.bundle/config”中编辑路径并尝试安装。不确定是否适合您的情况。
    Gemfile.lock
    是否已更改?@benjessop有一个.bundle目录,我尝试在其中设置路径,但没有成功。BUNDLE_路径:“vendor/cache”@Kache Gemfile.lock一点也没有改变,我在我们的主分支()上,只是尝试运行应用程序