Friday, March 20, 2009

Chapter 46: Sinatra Course #3

  1. Started some of the Heroku during Chapter 39 of this blog.
  2. Got my Heroku account.
  3. Installed heroku gem file. [~] $ gem install heroku (p.23)
    Successfully installed thor-0.9.9
    Successfully installed sequel-2.10.0
    Successfully installed taps-0.2.9
    Successfully installed heroku-0.6.1
    4 gems installed
    Installing ri documentation for thor-0.9.9...
    Installing ri documentation for sequel-2.10.0...
    Installing ri documentation for taps-0.2.9...
    Installing ri documentation for heroku-0.6.1...
    Installing RDoc documentation for thor-0.9.9...
    Installing RDoc documentation for sequel-2.10.0...
    Installing RDoc documentation for taps-0.2.9...
    Installing RDoc documentation for heroku-0.6.1...
  4. Had a lot of problems running heroku keys:add" so I created a shell script, heroku, and added it to my $HOME/bin directory . $ heroku keys:add (p.23)
    Uploading ssh public key C:\Users\/.ssh/id_rsa.pub
  5. Create config.ru in $HOME directory and put 'require "myapp"' and "run Sinatra::Application" in it.
  6. Set up Git (init, add, commit) for myapp. (p.24)
  7. Installed Git for Cygwin from Cygwin repository. (done)
  8. Run this: $ heroku create --remote 9p.25)
    Created http://electric-robot-51.heroku.com/ | git@heroku.com:electric-robot-51.git
    Git remote heroku added
  9. Ran this: $ heroku list 9p.25)
    young-night-98
    electric-robot-51
  10. Create git-remote: $ git remote add electricrobot git@heroku.com:electric-robot-51.git (p.25)
    $ git remote add electric git@heroku.com:electri
    c-robot-51.git
    fatal: remote electric already exists.
  11. Did this and got error: $ git push electricrobot master
    fatal: exec ssh failed.
    fatal: The remote end hung up unexpectedly
  12. Had to install OpenSSH from Cygwin repository.
  13. Got different response: $ git push heroku master (p.26)
    The authenticity of host 'heroku.com (75.101.145.87)' can't be established.
    RSA key fingerprint is .
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'heroku.com,75.101.145.87' (RSA) to the list of known ho
    sts.
    Permission denied (publickey).
    fatal: The remote end hung up unexpectedly
  14. Ran step 10: "Confirm:" $ heroku info --app electric-robot-51
    === electric-robot-51
    Web URL: http://electric-robot-51.heroku.com/
    Git Repo: git@heroku.com:electric-robot-51.git
    Collaborators: jasnow@hotmail.com
  15. Save this URL: http://heroku.disqus.com/heroku_api_and_external_git_access/
  16. http://zylstra.wordpress.com/2008/08/29/overcome-herokus-permission-denied-publickey-problem/
  17. Started over. Printed out a couple things. Read them. Redid "ssh-keygen -t dsa" and "heroku keys:add".
  18. Then tried the push again: $ git push heroku master
    The authenticity of host 'heroku.com (75.101.163.44)' can't be established.
    RSA key fingerprint is .
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'heroku.com,75.101.163.44' (RSA) to the list of known hosts.
    Enter passphrase for key '/home//.ssh/id_dsa':
    Counting objects: 14, done.
    Compressing objects: 100% (10/10), done.
    Writing objects: 100% (14/14), 2.76 KiB, done.
    Total 14 (delta 1), reused 0 (delta 0)

    -----> Heroku receiving push
    FAILED
    ! Heroku push rejected, no Rails or Rack app detected.

    error: hooks/pre-receive exited with error code 1
    To git@heroku.com:electric-robot-51.git
    ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'git@heroku.com:electric-robot-51.git'
  19. SINATRA INTERVIEW EXAMPLE: $ mkdir wiki
    $ cd wiki
    $ git init
    Initialized empty Git repository in /cygdrive/c/Documents and Settings/jasnow/gitlcalrepo/wiki/.git/
    $ heroku create
    Created http://severe-moon-59.heroku.com/ | git@heroku.com:severe-moon-59.git
    Git remote heroku added
  20. $ git push heroku master
    Enter passphrase for key '/home/jasnow/.ssh/id_rsa':
    Counting objects: 4, done.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (4/4), 831 bytes, done.
    Total 4 (delta 0), reused 0 (delta 0)
    -----> Heroku receiving push
    -----> Rack app detected
    Compiled slug size is 0.0MB
    -----> Launching......... done
    App deployed to Heroku
    To git@heroku.com:severe-moon-59.git

    * [new branch] master -> master
  21. Now that Wiki example works, I repeated it for original example (see step 18). $ git push heroku master
    Enter passphrase for key '/home/jasnow/.ssh/id_rsa':
    Counting objects: 17, done.
    Compressing objects: 100% (12/12), done.
    Writing objects: 100% (17/17), 3.04 KiB, done.
    Total 17 (delta 2), reused 0 (delta 0)
    -----> Heroku receiving push
    -----> Rack app detected
    Compiled slug size is 0.0MB
    -----> Launching........ done
    App deployed to Heroku
    To git@heroku.com:electric-robot-51.git
    * [new branch] master -> master
  22. http://electric-robot-51.heroku.com/ worked.
  23. http://severe-moon-59.heroku.com/Home worked.

2 comments:

  1. Hi, good day, this post is very interesting..
    I just want to ask
    how did you solve Heroku push rejected, no Rails or Rack app detected?

    What changes did you make?

    Thanks..

    ReplyDelete
  2. you might want to try and copy past key generate from cygwin_root\home\[username]\.ssh\ to
    [windowsdrive]\users\[username]\.ssh

    this solved for me
    i am using windows 7

    ReplyDelete