`bundle install` fails (because of git protocol) - ruby

With this simple Gemfile,
source 'https://rubygems.org'
gem 'activerecord', "~> 2.2.3"
gem 'activerecord-sqlserver-adapter', github: 'arthrex/activerecord-sqlserver-adapter', :branch => '2-3-stable'
bundle install fails with
Fetching git://github.com/arthrex/activerecord-sqlserver-adapter.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=No error
Git error: command `git clone
"git://github.com/arthrex/activerecord-sqlserver-adapter.git"
"c:/Languages/Ruby/1.9.3/lib/ruby/gems/1.9.1/cache/bundler/git/activerecord-sqlserver-adapter-8019982c6a12a1297e8a135275
d94bdee6cd893b"
--bare --no-hardlinks` in directory c:/Users/BZISAD0/Code/CSV has failed.
At first I thought my proxy configurations were screwed up but I can execute this command with no problem:
$ git clone http://github.com/arthrex/activerecord-sqlserver-adapter.git
With the git protocol, however, it fails:
$ git clone git://github.com/arthrex/activerecord-sqlserver-adapter.git
Cloning into 'activerecord-sqlserver-adapter'...
fatal: unable to connect to github.com:
github.com[0: 192.30.252.130]: errno=No error
so I'm inferring that the proxy is not playing nice with the git protocol. At any rate, for whatever reason, http is working fine but the git protocol is not.
Is there a way to work around this? E.g. configuring the use of http:// rather than git:// in my ~/.gitconfig?

Don't use the github: short form in your Gemfile, just use the regular git: syntax
gem 'activerecord-sqlserver-adapter', git: 'http://github.com/arthrex/activerecord-sqlserver-adapter.git'

Related

berks install found nothing to rewrite

I am using a Windows 7 x64 computer, with ChefDK 0.3.0-1 installed, with the berkshelf, and omnibus gems installed as well. I setup my Berksfile and metadata.rb files as such
metadata.rb
depends 'users', '~> 1.7'
depends 'sudo', '~> 2.6'
Berksfile
cookbook 'users', git: 'https://github.com/sethvargo-cookbooks/users.git', rel: 'cookbooks/users', tag: 'v1.7.0'
cookbook 'sudo', git: 'https://github.com/opscode-cookbooks/sudo.git', rel: 'cookbooks/sudo', tag: 'v2.6.0'
I set the environment variable in my System Environment Variables to:
BERKSHELF_PATH=C:/
However, when I issue the command:
> berks install
I get the following error:
C:\c\c\cookbook_test> berks install
Resolving cookbook dependencies...
Fetching 'addm_setup' from source at .
Fetching 'sudo' from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0/cookbooks/sudo)
Git error: command `git filter-branch --subdirectory-filter "cookbooks/sudo" --force` failed. If this error persists, try removing the cache directory at 'C:/chef/.cache/git/6f5ef5c786d127e1b549253a13b5d48c181aedeb'.Output from the command:
Found nothing to rewrite
I figured out I can't use the Cygwin Git, either because I don't know what to configure for it or something, and that the Git from git-scm works so far. I'm also using Windows Command Prompt to execute these commands. I'm not sure what to do from here, or what this is trying to tell me.
Unfortunately, and fortunately, this was a simple answer. I was receiving the errors listed in the question because I had the
rel: 'cookbooks/sudo'
What that was doing was looking for a pre-existing repository, but that didn't exist. So, once I removed that, the cookbooks were downloaded and included for use.
The new results were:
C:\c\c\cookbook_test> berks install
Resolving cookbook dependencies...
Fetching 'cookbook_test' from source at .
Fetching 'sudo' from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0)
Fetching 'users' from https://github.com/sethvargo-cookbooks/users.git (at v1.7.0)
Fetching cookbook index from https://supermarket.getchef.com...
Using cookbook_test (0.1.0) from source at .
Using sudo (2.6.0) from https://github.com/opscode-cookbooks/sudo.git (at v2.6.0)
Using users (1.7.0) from https://github.com/sethvargo-cookbooks/users.git (at v1.7.0)

Can't clone repository with Rugged

Using openSUSE and Ubuntu with installed dependencies I can't clone the remote repository with Rugged::Repository.clone_at method and getting the error message:
Rugged::NetworkError: This transport isn't implemented. Sorry
The code:
credentials = Rugged::Credentials::SshKey.new(:privatekey=>'path/to/privatekey', :publickey=>'path/to/publickey', :passphrase=>'passphrase')
Rugged::Repository.clone_at 'ssh://github.com/vmoravec/repo', 'dir/to/destination', :credentials => credentials
My Gemfile for a rails project contais reference to the github repo like this:
gem 'rugged', git: 'git://github.com/libgit2/rugged.git', branch: 'development', submodules: true
The gem has been installed with command bundle install --path bundle/
The cloning does not work even with using bundle exec rails console
Installed system packages:
libssh2, libssh2-devel
openssl, libopenssl-devel, libopenssl
There is already similar question asked here on SO, but the solution does not work (although it's for MacOS I think): Getting Rugged::NetworkError on #connect
Removing the bundle/ directory and reinstalling the gems with bundle install --path bundle/ resolved the issue on both systems. It seems that the build system was not able for some reasons to detect the /usr/lib64/libssh2.so.1 dependency required for ssh transport. Carlos, thanks for the hint to use ldd rugged.so to check that.

Push to Heroku hanging after ative_admin fetch

Guys I have no clue why this push to Heroku isn't working. Any ideas?
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
Bundler Output: Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Fetching git://github.com/justinfrench/formtastic.git
Fetching git://github.com/josevalim/inherited_resources.git
Fetching git://github.com/ernie/ransack.git
Fetching git://github.com/gregbell/active_admin.git
fatal: Could not parse object '54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f'.
Git error: command `git reset --hard 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f`
in directory
/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/bundler/gems/active_admin-54fb71c5415f
has failed.
If this error persists you could try removing the cache directory
'/tmp/build_1660sx0l4npgk/vendor/bundle/ruby/2.0.0/cache/bundler/git/active_admin-d67faab65e9b74efbc8efb4a777a851e9f78b2ca'
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby/Rails app
I had this error today and found that my Gemfile.lock file included a reference to the same commit you were using:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: 54fb71c5415f7b1a7aa0cdde680ee882fa3b2d6f
branch: rails4
specs:
activeadmin (0.6.0)
...
I'm not sure why that commit is no longer available but I was able to specify one in my Gemfile using the :ref option:
gem 'activeadmin', github: 'gregbell/active_admin', branch: 'rails4', ref: 'a9949c1524205928b18597f840e83478ba97c2ef'
The resulting change to Gemfile.lock:
GIT
remote: git://github.com/gregbell/active_admin.git
revision: a9949c1524205928b18597f840e83478ba97c2ef
ref: a9949c1524205928b18597f840e83478ba97c2ef
branch: rails4
specs:
activeadmin (0.6.0)
...
This feels like a safer way to control when including libraries directly from Github.

Error while fetching git file using Bundler

Gemfile:
source "http://rubygems.org"
gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git"
When I run bundle, the following error occurs:
Fetching git://github.com/tenderlove/nokogiri.git
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/source.rb:592:in ``': No such file or directory - git clone "git://github.com/tenderlove/nokogiri.git" "C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/nokogiri-d4bf05cb9e65f144f074351e5ebe3a0e44c00952" --bare --no-hardlinks (Errno::ENOENT)
How can I solve it?
It's reproducible not only with this gem but also with other gems: cucumber, capybara
I use Windows.
It was because I didn't have Git installed.
I installed Git and added it into PATH system variable. bundle became to work after that
For any other newbies out there, I installed Git on Windows 7 with msysgit.
Then in the msysgit command window (MINGW32) I moved to my rails project directory and ran bundle install and it worked fine.
Thanks for helping me with this Andrey.

error: "fatal: I don't handle protocol ``git` when using bundle install

I have the following line in my GemFile :
gem 'rails', :git => 'git://github.com/rails/rails.git'
I get the following error:
Fetching git://github.com/rails/rails.git
fatal: I don't handle protocol ''git'
Git error: command `git clone 'git://github.com/rails/rails.git'...
but when I run gem install 'rails' it works fine.
basically when running the clone command, bundler adds the single quotes around the git:// address which throws the error.
I am working on windows. Any ideas why I am getting this error?
Cheers
Try this instead in your Gemfile:
gem 'rails', :git => "https://github.com/rails/rails.git"
git:// can sometimes be blocked by firewalls. Though in your case that's probably not the issue. Try double quotes instead.
It's the issue with the newer version of the Bundler 1.0.14.
I needed to revert to 1.0.13 to make it work. They apparently had some issues dealing with escape characters in Windows.
See here > https://github.com/carlhuda/bundler/issues/1212

Resources