首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >bundle安装工作,但是bundle-show会出现错误"rails.git还没有签出。

bundle安装工作,但是bundle-show会出现错误"rails.git还没有签出。
EN

Stack Overflow用户
提问于 2013-01-21 23:13:43
回答 1查看 3.1K关注 0票数 1

我最近更新了我们的Gemfile,以便在我们的github帐户上使用分叉的复制rails。我们已经在2.3稳定的分支上创建了一个自定义分支(我将称之为the_bugfix_branch),并为每个宝石添加了宝石规格,以使它们可以通过bundler找到。

我的Gemfile有以下内容:

代码语言:javascript
复制
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输出中):

代码语言:javascript
复制
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:

代码语言:javascript
复制
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)

但是,如果我试图旋转服务器,它会告诉我:

代码语言:javascript
复制
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,我也会得到完全相同的消息。

代码语言:javascript
复制
> 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 (只是为了刺激),它会给出:

代码语言:javascript
复制
> 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安装。

我在谷歌上搜索过“还没有签出。请在尝试启动应用程序之前运行bundle install”,所有的"__bundle install将无法工作“的问题,我可以找到似乎是”运行bundle install,然后签入您的副本Gemfile.lock__“.显然我已经做过了。他们也倾向于捆绑安装失败的生产,但我的方式也失败了在开发。

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

google的一些结果告诉我尝试删除. .bundle/config并再次运行它。我试过同样的效果。

具体来说,我浏览了这个疑难解答指南的所有rm -rf行:重新运行包安装之前的https://github.com/carlhuda/bundler/blob/master/ISSUES.md

错误消息没有更改。

有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-22 01:29:05

Taryn East说:

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

结果我错了。

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

代码语言:javascript
复制
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

邦德勒一边被版本号搞混了,一边又把树枝弄糊涂了。

明确设置每个创业板上市的分支,似乎终于做到了!

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14448902

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档