【问题标题】:bundle install works, but bundle-show gives error "rails.git is not yet checked out. Please run `bundle install`"bundle install 工作,但 bundle-show 给出错误“rails.git 尚未签出。请运行`bundle install`”
【发布时间】:2013-01-05 02:43:28
【问题描述】:

我最近更新了我们的 Gemfile 以在我们的 github 帐户上使用分叉的副本 rails。我们从 2.3-stable 分支(我将其称为 the_bugfix_branch)创建了一个自定义分支,并为每个 gem 添加了 gemspec,以使它们可以被 bundler 找到。

我的 Gemfile 有以下内容:

git 'git://github.com/ourgithub/rails.git', :branch => "the_bugfix_branch"  do
  # Note: load-order is essential for dependencies
  gem 'activesupport', '2.3.2' # this must go first
  gem 'actionpack',    '2.3.2' # this must go second
  gem 'actionmailer',  '2.3.2' 
  gem 'activerecord',  '2.3.2' 
  gem 'activeresource','2.3.2' 
  gem 'rails',         '2.3.2' # this must go last
end

bundle install 快​​乐地运行给我(在所有其余的 gem 输出中):

Using actionpack (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch) 
Using actionmailer (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch) 
Using activesupport (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch) 
Using activerecord (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch) 
Using activeresource (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch) 
...
Using rails (2.3.2) from git://github.com/ourgithub/rails.git (at the_bugfix_branch)
...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

然后我签入并提交 Gemfile.lock,其中包含:

GIT
  remote: git://github.com/ourgithub/rails.git
  revision: 3fc562f9b1def3ad9a7abbfd5ccfa713a6dbc39f
  branch: the_bugfix_branch
  specs:
    actionmailer (2.3.2)
      actionpack (= 2.3.2)
    actionpack (2.3.2)
      actionpack (= 2.3.2)
    activerecord (2.3.2)
      activesupport (= 2.3.2)
    activeresource (2.3.2)
      activesupport (= 2.3.2)
    activesupport (2.3.2)
    rails (2.3.2)
      actionmailer (= 2.3.2)
      actionpack (= 2.3.2)
      activerecord (= 2.3.2)
      activeresource (= 2.3.2)
      activesupport (= 2.3.2)
      rake (>= 0.8.3)

但是,如果我尝试启动服务器,它会告诉我:

The git source git://github.com/ourgithub/rails.git is not yet checked out. Please run `bundle install` before trying to start your application

如果我尝试bundle show railsbundle check,我也会收到完全相同的消息:

> bundle show rails
The git source git://github.com/ourgithub/rails.git is not yet checked out. Please run `bundle install` before trying to start your application
> bundle check
git://github.com/ourgithub/rails.git (at the_bugfix_branch) is not checked out. Please run `bundle install`

如果我尝试bundle install --deployment(只是为了好玩)它会给出:

> bundle install --deployment
You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

You have added to the Gemfile:
* source: git://github.com/ourgithub/rails.git (at the_bugfix_branch)

You have deleted from the Gemfile:
* source: git://github.com/ourgithub/rails.git (at the_bugfix_branch)

You have changed in the Gemfile:
* activeresource from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`
* activerecord from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`
* actionmailer from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`
* actionpack from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`
* activesupport from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`
* rails from `git://github.com/ourgithub/rails.git (at the_bugfix_branch)` to `no specified source`

我显然没有只是更改了我的 Gemfile,而且自从我将这些东西添加到 Gemfile 以来,我肯定运行了 bundle install。

我已经用谷歌搜索了 “尚未签出。请在尝试启动您的应用程序之前运行 bundle install 并且所有 bundle install 将不起作用” 我能找到的问题似乎是 “只需运行 bundle install 然后检查您的 Gemfile.lock 副本”...我显然已经完成了。它们也往往是关于捆绑安装在生产中失败的问题,但我的在开发中也以这种方式失败。

我不认为这是一个简单的 Gemfile/Gemfile.lock 不匹配问题!

一些谷歌结果告诉我尝试删除 .bundle/config 并再次运行它。我已经尝试过同样的(缺乏)效果。

具体来说,在重新运行捆绑安装之前,我浏览了本故障排除指南的所有 rm -rf 行:https://github.com/carlhuda/bundler/blob/master/ISSUES.md

错误消息没有变化。

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails github gem bundler


    【解决方案1】:

    Taryn East 说:

    我不认为这是一个简单的 Gemfile/Gemfile.lock 不匹配问题!

    原来我错了。

    解决方案是删除 Gemfile 中的版本号,并明确使用分支:

    git 'git://github.com/ourgithub/rails.git', :branch => "the_bugfix_branch"  do
      # Note: load-order is essential for dependencies
      gem 'activesupport', :branch => "the_bugfix_branch" # this must go first
      gem 'actionpack',    :branch => "the_bugfix_branch" # this must go second
      gem 'actionmailer',  :branch => "the_bugfix_branch" 
      gem 'activerecord',  :branch => "the_bugfix_branch" 
      gem 'activeresource',:branch => "the_bugfix_branch" 
      gem 'rails',         :branch => "the_bugfix_branch" # this must go last
    end
    

    bundler 一方面对版本号感到困惑,另一方面对分支感到困惑。

    为列出的每个 gem 显式设置分支,似乎终于成功了!

    【讨论】:

      猜你喜欢
      • 2016-06-01
      • 2015-03-12
      • 2012-04-21
      • 1970-01-01
      • 1970-01-01
      • 2017-09-04
      • 1970-01-01
      • 1970-01-01
      • 2011-10-02
      相关资源
      最近更新 更多