【问题标题】:How don't create gem executables when using bundle in a rails project?在 Rails 项目中使用 bundle 时如何不创建 gem 可执行文件?
【发布时间】:2015-07-28 01:02:41
【问题描述】:

我在我的 rails 项目中运行了这个命令:

bundle --binstubs

这创建了一个bin/ 目录并为我的 Gemfile 中的 gem 生成了所有可执行文件。 但我不需要它们。每次我运行bundle install 时,它都会生成所有这些可执行文件。

当我运行bundle install 时如何忽略它们?

【问题讨论】:

  • 查看bundle 的文档,您可以使用bundle --binstubs[=<directory>] 指定放置它们的目录。

标签: ruby-on-rails ruby gem bundle bin


【解决方案1】:

--binstubs 是 Bundler 的"remembered options" 之一,这意味着一旦您使用它,它就会将该值保存到本地配置文件(.bundle/config,相对于您的 Gemfile 的位置)。您可以随时打开该文件并自行编辑,也可以运行:

bundle install --no-binstubs

并且 bundler 应该记住在将来安装 binstubs。现在,如果上述方法不适用于您的 bundler 版本,您可能需要运行:

bundle config --delete bin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-03-02
    • 2021-04-06
    • 1970-01-01
    • 1970-01-01
    • 2017-07-27
    • 1970-01-01
    • 2023-03-27
    相关资源
    最近更新 更多