jef*_*ner 5 git ruby-on-rails heroku
我把我的第5章Sample_App推到git,然后当我'git push heroku'时,我得到:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
! No such app as sample_app.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)
我已经阅读了一些类似的stackoverflow问题,所以我知道看看'git remote -v':
heroku git@heroku.com:sample_app.git (fetch)
heroku git@heroku.com:sample_app.git (push)
origin git@github.com:jeffbenner/sample_app.git (fetch)
origin git@github.com:jeffbenner/sample_app.git (push)
Run Code Online (Sandbox Code Playgroud)
我已经尝试删除heroku并重新推送 - 我收到相同的错误消息.
我看了'git config -l':
user.name=jeffbenner
user.email=xxxxx@gmail.com
alias.co=checkout
push.defaults=simple
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=false
remote.origin.url=git@github.com:jeffbenner/sample_app.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
remote.heroku.url=git@heroku.com:sample_app.git
remote.heroku.fetch=+refs/heads/*:refs/remotes/heroku/*
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚为什么我不能推向Heroku.我通过CLI重新登录了我的Github和Heroku帐户.任何方向都会非常感激.
小智 8
我刚遇到同样的问题.我做了以下事情:
cd .git
vim config
Run Code Online (Sandbox Code Playgroud)
删除所有引用Heroku的行
cd ..
heroku create
git push heroku master
Run Code Online (Sandbox Code Playgroud)
......瞧,它有效.
希望这会有所帮助.
您是否尝试指定您要推送的分支。尝试git push heroku master。您可以在文档中阅读有关警告的信息。让我知道它是否有效
编辑
我会重新开始并创建一个新的 Heroku 地址。按顺序执行以下步骤
首先Gemfile创建这些组
group :development do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
Run Code Online (Sandbox Code Playgroud)
重要的是,确保你处于root你的状态project并确保你bundle install像这样跑步
bundle install --without production
Run Code Online (Sandbox Code Playgroud)
接着git add .git commit -m 'your commit message'
现在heroku login从命令行运行
现在运行heroku create
然后git push heroku master
最后heroku open将在浏览器中打开您的应用程序
如果所有这些都不起作用,则将应用程序移动到一个新的目录中,然后从头开始git init,git add .然后git commit -m 'first commit in new location'按照上面的步骤开始heroku login
请注意,heroku 和 github 都使用 git,但它们是独立的实体。如果您可以将代码推送到 github 并且在 github 上看到它,那么您应该能够毫无问题地将代码推送到 heroku。如果没有,您可能在计算机上本地使用 git 时出现问题。
| 归档时间: |
|
| 查看次数: |
16266 次 |
| 最近记录: |