Heroku中的路径无效

时间:2011-08-31 02:44:12

标签: ruby-on-rails ruby ruby-on-rails-3 heroku

每次我尝试将我的rails应用程序部署到heroku上时都会说

Michael$ heroku create
Creating stormy-window-812..... done, stack is bamboo-mri-1.9.2
http://stormy-window-812.heroku.com/ | git@heroku.com:stormy-window-812.git

Michael$ git push heroku master

 !  Invalid path.
 !  Syntax is: git@heroku.com:.git where  is your app's name

fatal: The remote end hung up unexpectedly

我不确定是什么问题。我做一个普通的heroku创建,我的git正在为github加载代码。有什么我想念的吗?路径似乎是正确的格式,所以我不知道问题是什么。

6 个答案:

答案 0 :(得分:6)

你的.git/config已经过去了。

确保heroku的远程指向:

git@heroku.com:stormy-window-812.git

答案 1 :(得分:1)

在你的过程中某处必须有一些失误,我使用以下命令创建了一个示例应用程序 - 希望这有助于您确定哪些方面不正确。

只是命令列表:

$ rails new sample_app
$ cd sample_app/
$ git init
$ git add .
$ git commit -m "Initial commit"
$ heroku create
$ git push heroku master
$ heroku open

这些命令带有一些截断的输出:

$ rails new sample_app
    create  
    create  README
    create  Rakefile
    create  config.ru
    create  .gitignore
# ..snip..

$ cd sample_app/

$ git init
Initialized empty Git repository in /sample_app/.git/

$ git add .

$ git commit -m "Initial commit"
[master (root-commit) 487a313] Initial commit
 37 files changed, 1138 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 Gemfile
 create mode 100644 Gemfile.lock
 create mode 100644 README
# ..snip..

$ heroku create

$ git push heroku master
Counting objects: 63, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (63/63), 24.81 KiB, done.
Total 63 (delta 2), reused 0 (delta 0)

-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Configure Rails 3 to disable x-sendfile
       Installing rails3_disable_x_sendfile... done
-----> Configure Rails to log to stdout
       Installing rails_log_stdout... done
-----> Gemfile detected, running Bundler version 1.0.7
        Unresolved dependencies detected; Installing...
        Using --without development:test
        Fetching source index for http://rubygems.org/
        Installing rake (0.9.2) 
        Installing multi_json (1.0.3) 
        Installing activesupport (3.1.0.rc6)
# ..snip..

-----> Compiled slug size is 5.6MB
-----> Launching... done, v4
       http://gentle-water-874.heroku.com deployed to Heroku

To git@heroku.com:gentle-water-874.git
 * [new branch]      master -> master

$ heroku open

答案 2 :(得分:1)

重命名我的应用后,我遇到了这个问题。如果你这样做     heroku rename newname

然后你必须做     git remote rm heroku
    git remote add heroku git@heroku.com:newname.git

答案 3 :(得分:0)

我认为您需要cd进入您的app目录。然后再次推动。

另外,请确保将heroku添加为遥控器,然后再试一次:

git remote add heroku git@heroku.com:appname.git

答案 4 :(得分:0)

我的.git / config显然已经过了 - 我尝试多次更改为first_app,如上所示(newby:RoR Tutorial第1章)。删除/.git/config并按照' git init'开始执行上述步骤修复了config:url = git@heroku.com:dry-eyrie-8108.git

答案 5 :(得分:0)

它也很简单:

  1. $ heroku login
  2. $ heroku git:clone -a appname(这条线就在这里为我解决了)
  3. $ git add。
  4. $ git commit -am“make it better”
  5. $ git push heroku master