Rails三兩事 A website introduce you ruby&rails and technology news.

7May/101

搬移專案到Heroku. 疑難雜症.

原本使用Hosting Rails. 最近因為官方升級,很多問題.
做為一個主機商,一兩天就算了. 一週實在太超過.
版上抱怨也都得沒到解決,發Email連收也沒收到,只差沒打電話..

怕SliceHost也會有類似問題,而且也是一次先預付..索性將專案搬移到Heroku. 使用量到才需要付多一點.
過程遇到一些問題,紀錄一下.
ssh-key問題 :

$ heroku clone hobocookbook [/Data/Rails] [DrTeeth]
Initialized empty Git repository in /Data/Rails/hobocookbook/.git/
The authenticity of host 'heroku.com (75.101.141.116)' can't be established.
RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'heroku.com,75.101.141.116' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
...以下省略

解法 :

heroku keys:clear; sudo ssh-keygen -t rsa; heroku keys:add /root/.ssh/id_rsa.pub

然後再做你原本想做的事情.

taps (for Database Upload) 問題 :

~$ sudo gem install taps
[sudo] password for mike:
Building native extensions.  This could take a while…
ERROR:  Error installing taps:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb install taps
checking for fdatasync() in -lrt… yes
checking for sqlite3.h… no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
Provided configuration options:
–with-opt-dir
–without-opt-dir
–with-opt-include
–without-opt-include=${opt-dir}/include
...以下省略

解法 :

sudo aptitude install libsqlite3-dev libsqlite3-doc

taps 無法上傳 :

$ heroku db:push "~/xxx/db/xxx.sqlite3"
Loaded Taps v0.3.5
Warning: Data in the app 'xxx' will be overwritten and will not be recoverable.
Are you sure you wish to continue? (y/n)? y
Failed to connect to database:
  ArgumentError -> interning empty string

解法 :

heroku db:push --app yourappname

這個最蝦. - -

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
Comments (1) Trackbacks (0)
  1. git push heroku master
    fatal: ‘heroku’ does not appear to be a git repository
    fatal: The remote end hung up unexpectedly

    當push失敗的話,
    可以用 git remote檢查heroku是URL或是 是否存在,
    沒有的話可以使用 git remote add heroku [URL] 做加入的動作
    這樣應該可以正常的push 到 heroku了!


Leave a comment


No trackbacks yet.