捆绑无法找到明确安装的宝石

时间:2018-06-11 20:57:07

标签: ruby rubygems bundle

我有一个非常奇怪的问题,我可以清楚地看到安装了一个gem文件,因此可以捆绑,但是当我尝试运行它时,我收到一个错误,捆绑无法找到它

宝石文件:

source "https://rubygems.org/"

gem 'kitchen-terraform'

捆绑环境:

## Environment

```
Bundler       1.16.2
  Platforms   ruby, x64-mingw32
Ruby          2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
  Full Path   C:/Ruby25-x64/bin/ruby.exe
  Config Dir  C:/ProgramData
RubyGems      2.7.6
  Gem Home    C:/Ruby25-x64/lib/ruby/gems/2.5.0
  Gem Path    C:/Users/rperkins/.gem/ruby/2.5.0;C:/Ruby25-x64/lib/ruby/gems/2.5.0
  User Path   C:/Users/rperkins/.gem/ruby/2.5.0
  Bin Dir     C:/Ruby25-x64/bin
Tools
  Git         2.7.2.windows.1
  RVM         not installed
  rbenv       not installed
  chruby      not installed
```

## Bundler Build Metadata

```
Built At          2018-05-16
Git SHA           9f7bf0ac3
Released Version  true
```

## Gemfile

### Gemfile

```ruby
source "https://rubygems.org/"

gem 'kitchen-terraform'
```

### Gemfile.lock

```
GEM
  remote: https://rubygems.org/
  specs:
    addressable (2.5.2)
      public_suffix (>= 2.0.2, < 4.0)
    aws-sdk (2.11.65)
      aws-sdk-resources (= 2.11.65)
    aws-sdk-core (2.11.65)
      aws-sigv4 (~> 1.0)
      jmespath (~> 1.0)
    aws-sdk-resources (2.11.65)
      aws-sdk-core (= 2.11.65)
    aws-sigv4 (1.0.2)
    azure_mgmt_resources (0.16.0)
      ms_rest_azure (~> 0.10.0)
    builder (3.2.3)
    coderay (1.1.2)
    concurrent-ruby (1.0.5)
    declarative (0.0.10)
    declarative-option (0.1.0)
    diff-lcs (1.3)
    digest-crc (0.4.1)
    docker-api (1.34.2)
      excon (>= 0.47.0)
      multi_json
    domain_name (0.5.20180417)
      unf (>= 0.0.5, < 1.0.0)
    dry-configurable (0.7.0)
      concurrent-ruby (~> 1.0)
    dry-container (0.6.0)
      concurrent-ruby (~> 1.0)
      dry-configurable (~> 0.1, >= 0.1.3)
    dry-core (0.4.6)
      concurrent-ruby (~> 1.0)
    dry-equalizer (0.2.1)
    dry-inflector (0.1.2)
    dry-logic (0.4.2)
      dry-container (~> 0.2, >= 0.2.6)
      dry-core (~> 0.2)
      dry-equalizer (~> 0.2)
    dry-types (0.13.2)
      concurrent-ruby (~> 1.0)
      dry-container (~> 0.3)
      dry-core (~> 0.4, >= 0.4.4)
      dry-equalizer (~> 0.2)
      dry-inflector (~> 0.1, >= 0.1.2)
      dry-logic (~> 0.4, >= 0.4.2)
    dry-validation (0.12.0)
      concurrent-ruby (~> 1.0)
      dry-configurable (~> 0.1, >= 0.1.3)
      dry-core (~> 0.2, >= 0.2.1)
      dry-equalizer (~> 0.2)
      dry-logic (~> 0.4, >= 0.4.0)
      dry-types (~> 0.13.1)
    erubis (2.7.0)
    excon (0.62.0)
    faraday (0.15.2)
      multipart-post (>= 1.2, < 3)
    faraday-cookie_jar (0.0.6)
      faraday (>= 0.7.4)
      http-cookie (~> 1.0.0)
    faraday_middleware (0.12.2)
      faraday (>= 0.7.4, < 1.0)
    ffi (1.9.25-x64-mingw32)
    google-api-client (0.19.8)
      addressable (~> 2.5, >= 2.5.1)
      googleauth (>= 0.5, < 0.7.0)
      httpclient (>= 2.8.1, < 3.0)
      mime-types (~> 3.0)
      representable (~> 3.0)
      retriable (>= 2.0, < 4.0)
    google-cloud (0.51.1)
      google-cloud-bigquery (~> 1.1)
      google-cloud-bigquery-data_transfer (~> 0.1)
      google-cloud-container (~> 0.1)
      google-cloud-dataproc (~> 0.1)
      google-cloud-datastore (~> 1.4)
      google-cloud-dlp (~> 0.1)
      google-cloud-dns (~> 0.28)
      google-cloud-error_reporting (~> 0.30)
      google-cloud-firestore (~> 0.21)
      google-cloud-language (~> 0.30)
      google-cloud-logging (~> 1.5)
      google-cloud-monitoring (~> 0.27)
      google-cloud-os_login (~> 0.1)
      google-cloud-pubsub (~> 0.30)
      google-cloud-resource_manager (~> 0.29)
      google-cloud-spanner (~> 1.3)
      google-cloud-speech (~> 0.29)
      google-cloud-storage (~> 1.10)
      google-cloud-trace (~> 0.31)
      google-cloud-translate (~> 1.2)
      google-cloud-video_intelligence (~> 1.0)
      google-cloud-vision (~> 0.28)
    google-cloud-bigquery (1.5.0)
      concurrent-ruby (~> 1.0)
      google-api-client (~> 0.19.8)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.6.2)
    google-cloud-bigquery-data_transfer (0.1.0)
      google-gax (~> 1.0)
    google-cloud-container (0.1.0)
      google-gax (~> 1.0.1)
    google-cloud-core (1.2.0)
      google-cloud-env (~> 1.0)
    google-cloud-dataproc (0.1.0)
      google-gax (~> 1.0.0)
    google-cloud-datastore (1.4.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      google-protobuf (~> 3.3)
    google-cloud-dlp (0.4.0)
      google-gax (~> 1.0)
    google-cloud-dns (0.28.0)
      google-api-client (~> 0.19.0)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.6.2)
      zonefile (~> 1.04)
    google-cloud-env (1.0.1)
      faraday (~> 0.11)
    google-cloud-error_reporting (0.30.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      stackdriver-core (~> 1.3)
    google-cloud-firestore (0.21.1)
      concurrent-ruby (~> 1.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
    google-cloud-language (0.30.0)
      google-gax (~> 1.0)
    google-cloud-logging (1.5.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      stackdriver-core (~> 1.3)
    google-cloud-monitoring (0.28.0)
      google-gax (~> 1.0)
    google-cloud-os_login (0.1.0)
      google-gax (~> 1.0.0)
    google-cloud-pubsub (0.30.2)
      concurrent-ruby (~> 1.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      grpc-google-iam-v1 (~> 0.6.9)
    google-cloud-resource_manager (0.29.0)
      google-api-client (~> 0.19.8)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.6.2)
    google-cloud-spanner (1.4.0)
      concurrent-ruby (~> 1.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      grpc-google-iam-v1 (~> 0.6.9)
    google-cloud-speech (0.29.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
    google-cloud-storage (1.12.0)
      digest-crc (~> 0.4)
      google-api-client (~> 0.19.0)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.6.2)
    google-cloud-trace (0.33.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
      stackdriver-core (~> 1.3)
    google-cloud-translate (1.2.0)
      faraday (~> 0.13)
      google-cloud-core (~> 1.2)
      googleauth (~> 0.6.2)
    google-cloud-video_intelligence (1.0.0)
      google-gax (~> 1.0)
    google-cloud-vision (0.28.0)
      google-cloud-core (~> 1.2)
      google-gax (~> 1.0)
    google-gax (1.0.1)
      google-protobuf (~> 3.2)
      googleapis-common-protos (>= 1.3.5, < 2.0)
      googleauth (~> 0.6.2)
      grpc (>= 1.7.2, < 2.0)
      rly (~> 0.2.3)
    google-protobuf (3.5.1.2-x64-mingw32)
    googleapis-common-protos (1.3.7)
      google-protobuf (~> 3.0)
      googleapis-common-protos-types (~> 1.0)
      grpc (~> 1.0)
    googleapis-common-protos-types (1.0.1)
      google-protobuf (~> 3.0)
    googleauth (0.6.2)
      faraday (~> 0.12)
      jwt (>= 1.4, < 3.0)
      logging (~> 2.0)
      memoist (~> 0.12)
      multi_json (~> 1.11)
      os (~> 0.9)
      signet (~> 0.7)
    grpc (1.12.0-x64-mingw32)
      google-protobuf (~> 3.1)
      googleapis-common-protos-types (~> 1.0.0)
      googleauth (>= 0.5.1, < 0.7)
    grpc-google-iam-v1 (0.6.9)
      googleapis-common-protos (>= 1.3.1, < 2.0)
      grpc (~> 1.0)
    gssapi (1.2.0)
      ffi (>= 1.0.1)
    gyoku (1.3.1)
      builder (>= 2.1.2)
    hashie (3.5.7)
    htmlentities (4.3.4)
    http-cookie (1.0.3)
      domain_name (~> 0.5)
    httpclient (2.8.3)
    inifile (3.0.0)
    inspec (2.2.10)
      addressable (~> 2.4)
      faraday (>= 0.9.0)
      faraday_middleware (~> 0.12.2)
      hashie (~> 3.4)
      htmlentities
      json (>= 1.8, < 3.0)
      method_source (~> 0.8)
      mixlib-log
      parallel (~> 1.9)
      parslet (~> 1.5)
      pry (~> 0)
      rspec (~> 3)
      rspec-its (~> 1.2)
      rubyzip (~> 1.1)
      semverse
      sslshake (~> 1.2)
      thor (~> 0.20)
      tomlrb (~> 1.2)
      train (~> 1.4.11)
    jmespath (1.4.0)
    json (2.1.0)
    jwt (2.1.0)
    kitchen-inspec (0.23.1)
      hashie (~> 3.4)
      inspec (>= 0.34.0, < 3.0.0)
      test-kitchen (~> 1.6)
    kitchen-terraform (3.3.1)
      dry-types (~> 0.9)
      dry-validation (~> 0.10)
      kitchen-inspec (~> 0.18)
      mixlib-shellout (~> 2.2)
      test-kitchen (~> 1.16)
    little-plugger (1.1.4)
    logging (2.2.2)
      little-plugger (~> 1.1)
      multi_json (~> 1.10)
    memoist (0.16.0)
    method_source (0.9.0)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mixlib-install (3.10.0)
      mixlib-shellout
      mixlib-versioning
      thor
    mixlib-log (2.0.4)
    mixlib-shellout (2.3.2-universal-mingw32)
      win32-process (~> 0.8.2)
      wmi-lite (~> 1.0)
    mixlib-versioning (1.2.2)
    ms_rest (0.7.2)
      concurrent-ruby (~> 1.0)
      faraday (~> 0.9)
      timeliness (~> 0.3)
    ms_rest_azure (0.10.8)
      concurrent-ruby (~> 1.0)
      faraday (~> 0.9)
      faraday-cookie_jar (~> 0.0.6)
      ms_rest (~> 0.7.2)
    multi_json (1.13.1)
    multipart-post (2.0.0)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-ssh (4.2.0)
    net-ssh-gateway (1.3.0)
      net-ssh (>= 2.6.5)
    nori (2.6.0)
    os (0.9.6)
    parallel (1.12.1)
    parslet (1.8.2)
    pry (0.11.3)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    public_suffix (3.0.2)
    representable (3.0.4)
      declarative (< 0.1.0)
      declarative-option (< 0.2.0)
      uber (< 0.2.0)
    retriable (3.1.2)
    rly (0.2.3)
    rspec (3.7.0)
      rspec-core (~> 3.7.0)
      rspec-expectations (~> 3.7.0)
      rspec-mocks (~> 3.7.0)
    rspec-core (3.7.1)
      rspec-support (~> 3.7.0)
    rspec-expectations (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-its (1.2.0)
      rspec-core (>= 3.0.0)
      rspec-expectations (>= 3.0.0)
    rspec-mocks (3.7.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.7.0)
    rspec-support (3.7.1)
    rubyntlm (0.6.2)
    rubyzip (1.2.1)
    semverse (2.0.0)
    signet (0.8.1)
      addressable (~> 2.3)
      faraday (~> 0.9)
      jwt (>= 1.5, < 3.0)
      multi_json (~> 1.10)
    sslshake (1.2.0)
    stackdriver-core (1.3.0)
      google-cloud-core (~> 1.2)
    test-kitchen (1.21.2)
      mixlib-install (~> 3.6)
      mixlib-shellout (>= 1.2, < 3.0)
      net-scp (~> 1.1)
      net-ssh (>= 2.9, < 5.0)
      net-ssh-gateway (~> 1.2)
      thor (~> 0.19)
      winrm (~> 2.0)
      winrm-elevated (~> 1.0)
      winrm-fs (~> 1.1)
    thor (0.20.0)
    timeliness (0.3.8)
    tomlrb (1.2.6)
    train (1.4.11)
      aws-sdk (~> 2)
      azure_mgmt_resources (~> 0.15)
      docker-api (~> 1.26)
      google-api-client (~> 0.19.8)
      google-cloud (~> 0.51.1)
      googleauth (~> 0.6.2)
      inifile
      json (>= 1.8, < 3.0)
      mixlib-shellout (~> 2.0)
      net-scp (~> 1.2)
      net-ssh (>= 2.9, < 5.0)
      winrm (~> 2.0)
      winrm-fs (~> 1.0)
    uber (0.1.0)
    unf (0.1.4)
      unf_ext
    unf_ext (0.0.7.5-x64-mingw32)
    win32-process (0.8.3)
      ffi (>= 1.0.0)
    winrm (2.2.3)
      builder (>= 2.1.2)
      erubis (~> 2.7)
      gssapi (~> 1.2)
      gyoku (~> 1.0)
      httpclient (~> 2.2, >= 2.2.0.2)
      logging (>= 1.6.1, < 3.0)
      nori (~> 2.0)
      rubyntlm (~> 0.6.0, >= 0.6.1)
    winrm-elevated (1.1.0)
      winrm (~> 2.0)
      winrm-fs (~> 1.0)
    winrm-fs (1.2.0)
      erubis (~> 2.7)
      logging (>= 1.6.1, < 3.0)
      rubyzip (~> 1.1)
      winrm (~> 2.0)
    wmi-lite (1.0.0)
    zonefile (1.06)

PLATFORMS
  x64-mingw32

DEPENDENCIES
  kitchen-terraform

BUNDLED WITH
   1.16.2
```

Bundle Doctor:

The Gemfile's dependencies are satisfied
No issues found with the installed bundle

好的,很棒的东西都安装得很清楚,所以试试吧。

捆绑执行厨房测试

Could not find aws-sdk-core-2.11.65 in any of the sources
Run `bundle install` to install missing gems.

这怎么可能,当我们运行bundle install时它已经清楚地安装了,我们可以在上面的bundle env中看到它。

捆绑信息aws-sdk-core:

  * aws-sdk-core (2.11.65)
        Summary: AWS SDK for Ruby - Core
        Homepage: http://github.com/aws/aws-sdk-ruby
        Path: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/aws-sdk-core-2.11.65

Bundle show aws-sdk-core:

C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/aws-sdk-core-2.11.65

3 个答案:

答案 0 :(得分:2)

由于路径不匹配,这种情况正在发生。 Bundler正在寻找一条不是你本地路径的路径。要么特别提到

  

gem install --path

或设置

  

BUNDLE_DISABLE_SHARED_GEMS:0

<。>在.bundle / config文件中。默认设置为true(1)。请谨慎使用,但重置此捆绑包设置将允许使用系统范围内安装的宝石。

答案 1 :(得分:1)

尝试在系统目录中安装gems,这可能会解决问题,因为您的gems似乎安装在2个单独的目录中 C:/Users/rperkins/.gem/ruby/2.5.0 C:/Ruby25-x64/lib/ruby/gems/2.5.0

使用以下命令通过捆绑器安装宝石:

bundle install --system

答案 2 :(得分:0)

使用此方法可能可以直接从rubygems获取索引:

bundle install --full-index