【问题标题】:Bundler can't load gems on pipelineBundler 无法在管道上加载 gem
【发布时间】:2018-01-04 17:20:58
【问题描述】:

我正在使用 bitbucket 的管道来测试和部署我的 rails 应用程序。在我添加一些真正的测试之前它工作正常,现在它给了我Bundler::GemNotFound 错误,我找不到原因。

这是我目前的bitbucket-pipelines.yml

image: ruby:2.4.3
pipelines:
  default:
    - step:
        caches:
          - bundler
        script:
          - bundle install --path vendor/bundle
          - cp config/application.example.yml config/application.yml
          - rails test -d
          - mina deploy

definitions:
  caches:
    bundler: ./vendor/bundle

Here is a gist with the raw log

我做错了什么?

编辑

用于调试目的的更多信息(仅相关部分):

宝石列表返回正确的宝石

$ bundle exec gem list
rails (5.1.4)
rake (12.3.0)

但是 rails 命令没有找到需要的 gems

$ bundle exec rails test -d
/usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find rake-12.3.0 in any of the sources (Bundler::GemNotFound)
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `map!'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/spec_set.rb:82:in `materialize'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/definition.rb:170:in `specs'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/definition.rb:237:in `specs_for'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/definition.rb:226:in `requested_specs'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:108:in `block in definition_method'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:20:in `setup'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler.rb:107:in `setup'
    from /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.16.1/lib/bundler/setup.rb:20:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/commands.rb:33:in `<module:Spring>'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/commands.rb:4:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:87:in `preload'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
    from /opt/atlassian/pipelines/agent/build/vendor/bundle/ruby/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from -e:1:in `<main>'

【问题讨论】:

标签: ruby-on-rails bitbucket-pipelines


【解决方案1】:

我解决了

bundle install --binstubs

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-15
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    • 1970-01-01
    • 2015-09-23
    • 1970-01-01
    相关资源
    最近更新 更多