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
Rails Authentication Across Apps/Servers
How to Change Hash Keys from 'Symbol's to 'String'S
What Are the Differences Between Rbenv, Rvm, and Chruby
Rails: Hasmanythroughassociationnotfounderror
Can Someone Explain Ruby's Use of Pipe Characters in a Block
Ruby/Rails - Models Named with Two Words (Naming Convention Issues)
Rails If Object.Nil? Then Magic '' in Views
How to Calculate the Offset, in Hours, of a Given Timezone from Utc in Ruby
Generate and Publish Ruby Based Rest APIs Documentation
Ruby Mixins: Extend and Include
How to Select Option in Drop Down Using Capybara
Ruby: How to Define a Class Method in a Module
How to Customize Gemfile Per Developer
Installed Rails But the Rails Command Says It's Not Installed
How to Use Ruby's Readlines.Grep for Utf-16 Files
Why Does This Nokogiri Xpath Have a Null Return
How to Turn Off Automatic Stylesheet/JavaScript Generation on Rails 3.1