Force Bundle Install to Use Https:// Instead of Git:// for Github-Based Gems

Force bundle install to use https:// instead of git:// for GitHub-based gems

Git provides URL rewriting functionality using the url..insteadOf configuration option.

So to make all connections to github.com use https:// rather than git://

git config --global url."https://github.com".insteadOf git://github.com

The --global switch sets the config option for all git operations by the current user, so there are times where it may be too intrusive. But it does avoid changing the git config in the current project.

Running bundle install changes git:// to https:// in Gemfile.lock

Upgrading to Bundler 1.7.2 seems to solve the problem.

Switch from git source protocol to encrypted https

turned out to be the ~/project/Gemfile specified the github source:

group :test do
gem 'shoulda-matchers', :git => 'git://github.com/thoughtbot/shoulda-matchers.git'
gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
end

Removing the , :git => 'PATH' gets me a secure https protocol install of the lastest gems. Added bonus: the gems also now show up when I gem list... FWIW: this isn't a project I wrote from scratch, I'm just helping someone out with theirs, but now I know!

How to resolve heroku You are trying to install in deployment mode after changing your Gemfile error?

Most answers simply indicate to delete gemfile.lock and run bundle install. However---there is a new message popping up bundler regarding https:

The git source `X` uses the `git` protocol, which transmits data without
encryption. Disable this warning with `bundle config git.allow_insecure true`,
or switch to the `https` protocol to keep your data secure.

following the message prompt created a new config file in ~/.bundle/config. This file was causing hell with heroku---deleting it got me back to work.

Unfortunately, heroku's stack trace offers no real direction in sorting this out. There are a number of reasons you could see the "You are trying to install in deployment mode after changing your Gemfile" message---and, heroku offers nothing in helping you figure out why it is unhappy.

Gemfile: Difference Between branch and ref in a github Reference

With branch, you're just specifying the git branch to pull from. If you did a bundle up <gem> when targeting a branch, it would update to the tip of that branch.

The ref is really nailing it down to an individual commit. You wouldn't give a "human-readable" name as you did in your question, you'd do something like:

gem 'something', github: 'someone/something', ref: '832e76a9'

And now you've pinned it to that ref. If you did a bundle up something, it wouldn't change that gem (it may update its dependencies though).



Related Topics



Leave a reply



Submit