无法使用Rugged克隆存储库

使用带有已安装依赖项的openSUSE和Ubuntu我无法使用Rugged::Repository.clone_at方法克隆远程存储Rugged::Repository.clone_at并收到错误消息:

Rugged :: NetworkError:未实现此传输。 抱歉

代码:

 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 

我的用于rails项目的Gemfile包含对github repo的引用,如下所示:

 gem 'rugged', git: 'git://github.com/libgit2/rugged.git', branch: 'development', submodules: true 

gem已经安装了命令bundle install --path bundle/即使使用bundle exec rails console ,克隆也不起作用

已安装的系统包:

  • libssh2,libssh2-devel
  • openssl,libopenssl-devel,libopenssl

在SO上已经有类似的问题,但解决方案不起作用(虽然我觉得它适用于MacOS): 在#connect上获取Rugged :: NetworkError

删除bundle/目录并使用bundle install --path bundle/重新安装gem bundle install --path bundle/解决了两个系统上的问题。 似乎构建系统由于某些原因无法检测到ssh传输所需的/usr/lib64/libssh2.so.1依赖性。 卡洛斯,感谢提示使用ldd rugged.so来检查。