Can't clone repository with Rugged

早过忘川 提交于 2019-12-11 09:26:39

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/23742305/cant-clone-repository-with-rugged

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!