When trying to clone a remote repo with Rugged, I keep getting the error
Failed to authenticate SSH session: Unable to open public key file
I add my ssh credentials fine, but when I come to doing the clone the above error occurs.
cred = Rugged::Credentials::SshKey.new({username: 'gabriel403', publickey: publickey, privatekey: privatekey})
Rails.logger.debug cred
Where publickey and privatekey are string holding the keys.
repo = Rugged::Repository.clone_at('git@github.com:gabriel403/dotfiles.git', '/tmp/dotfiles', {credentials: cred})
Rails.logger.debug repo