Reputation: 27757
I've recently updated our Gemfile to use a forked copy rails on our github account. We've created a custom branch off the 2.3-stable branch (which I'll call the_bugfix_branch
) and added gemspecs for each of the gems to make them findable by bundler.
My Gemfile has the following:
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
runs happily giving me (amongst all the rest of the gem output):
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.
I then checkin and commit Gemfile.lock which contains:
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)
However if I try to spin up the server, it tells me:
The git source git://github.com/ourgithub/rails.git is not yet checked out. Please run `bundle install` before trying to start your application
I also get the exact same message if I try bundle show rails
or bundle 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`
If I try bundle install --deployment
(just for kicks) it gives:
> 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`
I've clearly not just changed my Gemfile, and I most certainly have run bundle install since the time I did add that stuff to the Gemfile.
I've googled for "is not yet checked out. Please run bundle install
before trying to start your application" and all the "bundle install
won't work" questions that I can find seem to say "just run bundle install
then checkin your copy of Gemfile.lock
"... which I've clearly done. They also tend to be about bundle-install failing on production, but mine fails this way also on development.
I don't think this is a simple Gemfile/Gemfile.lock mismatch problem!
Some of the google results tell me to try removing .bundle/config and running it again. I've tried that to the same (lack of) effect.
Specifically, I went through all of the rm -rf
lines of this troubleshooting guide: https://github.com/carlhuda/bundler/blob/master/ISSUES.md before re-running bundle install.
No change in the error message.
Any ideas?
Upvotes: 1
Views: 3288
Reputation: 27757
Taryn East said:
I don't think this is a simple Gemfile/Gemfile.lock mismatch problem!
Turns out I was wrong.
The solution was to remove the version-numbers in the Gemfile, and explicitly use the branch instead:
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 was getting confused with the version-number on one hand, and the branch on the other.
Explicitly setting the branch for every gem listed, seemed to finally do the trick!
Upvotes: 4