dependencies - bundle 安装包括所有依赖项,即使使用 --without

标签 dependencies installation bundle bundler

我正在尝试安装Redmine 2.1.2在 Ubuntu 12.04 上,但我有一个依赖问题。简而言之,我正在运行以下命令:

bundle install --without development test mysql sqlite

bundle 会尝试安装所有依赖项,甚至是上面列出的组的依赖项以及与我的平台不对应的依赖项(是 ruby 而不是 jruby) .

这是我正在使用的 Gemfile 的链接:http://www.redmine.org/projects/redmine/repository/entry/tags/2.1.2/Gemfile

生成的Gemfile.lock如下:

GEM
  remote: http://localhost:6789/
  specs:
    actionmailer (3.2.8)
      actionpack (= 3.2.8)
      mail (~> 2.4.4)
    actionpack (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.0)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.1.3)
    activemodel (3.2.8)
      activesupport (= 3.2.8)
      builder (~> 3.0.0)
    activerecord (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.8)
      activemodel (= 3.2.8)
      activesupport (= 3.2.8)
    activesupport (3.2.8)
      i18n (~> 0.6)
      multi_json (~> 1.0)
    arel (3.0.2)
    builder (3.0.0)
    coderay (1.0.8)
    erubis (2.7.0)
    fastercsv (1.5.5)
    hike (1.2.1)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (2.0.2)
      railties (>= 3.2.0, < 5.0)
      thor (~> 0.14)
    json (1.7.5)
    mail (2.4.4)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    metaclass (0.0.1)
    mime-types (1.19)
    mocha (0.12.3)
      metaclass (~> 0.0.1)
    multi_json (1.3.6)
    mysql (2.8.1)
    mysql2 (0.3.11)
    net-ldap (0.3.1)
    pg (0.14.1)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-openid (1.3.1)
      rack (>= 1.1.0)
      ruby-openid (>= 2.1.8)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.8)
      actionmailer (= 3.2.8)
      actionpack (= 3.2.8)
      activerecord (= 3.2.8)
      activeresource (= 3.2.8)
      activesupport (= 3.2.8)
      bundler (~> 1.0)
      railties (= 3.2.8)
    railties (3.2.8)
      actionpack (= 3.2.8)
      activesupport (= 3.2.8)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (0.9.2.2)
    rdoc (3.12)
      json (~> 1.4)
    rmagick (2.13.1)
    ruby-openid (2.1.8)
    shoulda (2.11.0)
    sprockets (2.1.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.6)
    test-unit (2.5.2)
    thor (0.16.0)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.33)
    yard (0.8.2.1)

PLATFORMS
  ruby

DEPENDENCIES
  activerecord-jdbcmysql-adapter
  activerecord-jdbcpostgresql-adapter
  activerecord-jdbcsqlite3-adapter
  builder (= 3.0.0)
  coderay (~> 1.0.6)
  fastercsv (~> 1.5.0)
  i18n (~> 0.6.0)
  jquery-rails (~> 2.0.2)
  jruby-openssl
  mocha (= 0.12.3)
  mysql
  mysql2 (~> 0.3.11)
  net-ldap (~> 0.3.1)
  pg (>= 0.11.0)
  rack-openid
  rails (= 3.2.8)
  rdoc (>= 2.4.2)
  rmagick (>= 2.0.0)
  ruby-openid (~> 2.1.4)
  shoulda (~> 2.11)
  sqlite3
  test-unit
  yard

.bundle/config文件中,有一个ligne BUNDLE_WITHOUT:development:test:mysql:sqlite

我尝试删除 .bundleGemfile.lock~/.bundler~/。 gems 如 github 上 bundler 的故障排除页面所示(我无法发布,因为我没有 10 个声誉),但它没有改变任何内容。

我从本地存储库获取 gem ,其中只有我需要的 gem 。所以我修改了 Gemfile 中的 source (这就是为什么你在 Gemfile 中有一个 remote: http://localhost:6789 .lock)。因此,安装失败,因为 bundle 程序正在寻找我的服务器上不存在的 gem,并且理论上不需要。

感谢您的帮助

最佳答案

您可能需要向这些组中的某些 gem 添加 :require => false

关于dependencies - bundle 安装包括所有依赖项,即使使用 --without,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13267253/

相关文章:

visual-studio - Visual Studio 2015 更新 3 (KB3165756) 安装程序被阻止

perl - Ld.exe 已停止使用 Perl Strawberry 安装

php - 有没有办法自动更新 symfony2 中的 AppKernel?

.net - 相互依赖的子/父命名空间是代码异味吗?

java - Gradle 在目录中包含传递依赖项

c# - 如何使用命令行安装期间作为参数传递的值从 wix 自定义操作更新 appsettings.json?

ios - iOS 上的可加载包,有什么办法可以实现吗?

testing - Maven Transitive dependencies of dependencies in test scope included into a package

Gradle:如何从耳朵文件中排除jar?

java - OSGi 包和普通 .JAR 文件用法之间的区别