【问题标题】:Local Gem assets not updating本地宝石资产未更新
【发布时间】:2023-03-28 14:50:01
【问题描述】:

我已经分叉了一个 gem,并且在尝试更改它时,决定从我的 git 存储库中更改 gemfile(它一直在更新):

gem 'bootstrap-wysihtml5-rails', :git => 'git://github.com/Asherlc/bootstrap-wysihtml5-rails.git'

到本地目录(只是克隆的 git 存储库):

gem 'bootstrap-wysihtml5-rails', :path => '/Users/ashercohen/Documents/bootstrap-wysihtml5-rails'

在运行 bundle updatebundle install 时,它会在读数中显示正确的版本号(在切换 gem 源后更新)。但是,/vendor/assetspath 中的所有文件似乎都没有在我的 Rails 应用程序中得到更新。我需要清除某种缓存吗?

我的 Rails 应用程序中没有 /vendor/cache 文件,我确信由于 gem 版本在捆绑器读数中正确更新,因此路径正确。

这里有没有我遗漏的步骤?

【问题讨论】:

  • 我怀疑您缺少“depend_on”指令...我知道这可能听起来很奇怪,但是如果您在 application.js 和 application.css.scss 中添加随机注释,它会起作用吗文件?
  • 啊,谢谢!正如您的评论建议所揭示的那样,代码实际上正在更新。出于某种原因,Chrome 对它进行了报复性缓存,因此这些更改没有显示在控制台中。
  • 有一次我遇到了一个奇怪的问题,我的本地 gem 没有更新。通过从我的 gemfile 中删除 gem、运行 bundle install、添加回来并再次运行 bundle install 来解决它。

标签: ruby-on-rails ruby-on-rails-3 rubygems gem bundler


【解决方案1】:

原来 Chrome 只是在积极地缓存 JS。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-21
    • 2012-02-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多