我在追踪Ruby .铁路 struct .我运行命令"git push heroku master",它会抛出这个错误.

Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

我在我的rails应用程序"/Users/lexi87/rails_projects/first_app"中.有什么解决办法吗?

推荐答案

避免此类错误的最佳方法是为heroku使用一对公钥/私钥,而不是额外的密钥.这样,您(或您的系统)就不能 Select 错误的密钥登录heroku.

如果你犯了这个错误,说明你做错了什么.查看此网站:https://devcenter.heroku.com/articles/keys

如果你发现了这个错误,最好的方法是删除不必要的密钥,只使用一个.

如果系统上需要多个密钥对,可以为heroku设置一个密钥.这是通过以下命令完成的:

heroku keys:add

Ruby-on-rails相关问答推荐

别名可能与不同模型的相同别名有许多关联?

'elseif' 还存在吗?

Rails 3 应用程序的 MySQL 集群 (NDB) 与 MySQL 复制 (InnoDB):优点/缺点?

将 cookie 会话存储添加回 Rails API 应用程序

从 Authlogic 迁移到 Devise

OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server hello A

在 Rails 4 中检测用户代理 - 读取 HTTP 标头

HABTM 关系 - 如何根据关联模型的属性找到记录

在 Rails 中将 DateTime 字符串转换为 UTC

Rails - 如何在 f.submit 上放置确认弹出窗口?

Rails 3.1 插件 gem、虚拟测试应用程序、rspec

Rspec 与 TestUnit

设计自定义路由和登录页面

如何禁用 HTTP 严格传输安全性?

测试:如何在不损失速度的情况下专注于行为而不是执行?

Rails 4 pgsql add_index 类型为 GIN 或 GiST

rbenv:没有 gemsets 生存

Mongoid OR 查询语法

如何翻译 ActiveRecord 模型类名称?

find、where 和 find_by_id 有什么区别?