2012-07-31 2 views

답변

9

예. 가능합니다. 이 명령은 나와 같은 초보자에게는 분명하지 않았고 다른 사람을 도울 수 있습니다 ...

먼저 배포 된 새 앱을 호출 할 계획에 따라 현재 heroku에서 사용할 수있는 이름을 찾으십시오.

$ rake secret # generate new secret key for new app 
5ed8c7d9a3bda9cec3887b61f22aa95bf430a3a550407642b96751c7ef0ce8946a161506d6739da0dcaaea8c8f4f8b3335b1fb549e3cc54f0a4cec554ede05f8 

다음과 같은 새로 생성 된 비밀 키를 저장합니다

$ cp -R old_directory new_directory 
$ cd new_directory 
$ rm -rf .git 
# find and replace all references to old_director found within new_directory 
# the command at the terminal 'grep -ri "old_director" .' may help to locate 
# all of the references to the old_directory 
$ git init 
$ git add . 
$ git ci -am “First commit after copying from old_app” 
# create new_directory repository at github. Follow along their 
# directions for new repository with appropriate modifications. 
$ git remote add origin [email protected]:[github username]/[new_directory].git 
$ git push -u origin master 
$ rake db:migrate 
$ heroku create [new_app] 
$ git push heroku master 

새 응용 프로그램을위한 새로운 비밀 키를 생성하려면 : 과거와 생성 될 새로운 레일 응용 프로그램의 루트에서

다음 명령을 사용하여 Heroku의 환경 변수 :

$ heroku config:set SECRET_KEY_BASE=5ed8c7d9a3bda9cec3887b61f22aa95bf430a3a550407642b96751c7ef0ce8946a161506d6739da0dcaaea8c8f4f8b3335b1fb549e3cc54f0a4cec554ede05f8 

비밀 저장에 대한 자세한 내용 t 키 등은 환경 변수로 Daniel Fone's Blog에서 찾을 수 있습니다.

마지막 : 시험 : prepare` 또는`갈퀴 DB : 테스트 :`$ 레이크 데시벨 다음 migrate` :

$ heroku run rake db:migrate 
+0

는'$ 갈퀴 DB를 실행 load' 다음 실행 사양은 사전 좋은 생각이 될 수있다 헤로 쿠에게 힘 쓰고 배치하기. – BenU

+0

비밀 키를 변경해야합니까? – Onichan

+1

예 @ 오니 짱. '$ rake secret'을 사용하여 새로운 비밀 키를 생성하고 그것을 heroku 환경 변수로 저장해야합니다. 위의 지침을 편집하여 해당 단계를 포함시킵니다. – BenU

관련 문제