heroku 初次部署

2021-08-25 16:17:37 字數 2881 閱讀 4274

2、建立git 倉儲

進入專案目錄

git init

3、新增忽略檔案

vi .gitignore

輸入以下內容

*.swp

log/*.log

tmp/**/*

config/database.yml

然後 :wq 儲存退出

git 缺省會 replaced all of lf with crlf

處理方式:git config core.autocrlf false

4、bundler安裝

gem install bundler

這個如果是rails3的話,預設就會安裝的

在專案下建立gemfile檔案,輸入 source :gemcutter,然後儲存退出

bundle install

會生成gemfile.lock檔案,是遠端伺服器和本地開發環境同步gem用的

5、heroku 安裝建立

gem install heroku

heroku create alissa

=> createing alissa....done

| [email protected]:alissa.git

git remote heroku added

6、**上傳

git add .

git commit -a -m "project first commit"

git push heroku master

git.exe push --progress "heroku" master

-----> heroku receiving push

-----> 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

installing rake (0.8.7)

installing redcloth (4.2.7) with native extensions

installing aaronh-chronic (0.3.9)

installing abstract (1.0.0)

installing activesupport (3.0.4)

installing builder (2.1.2)

installing i18n (0.5.0)

installing activemodel (3.0.4)

installing erubis (2.6.6)

installing rack (1.2.1)

installing rack-mount (0.6.13)

installing rack-test (0.5.7)

installing tzinfo (0.3.24)

installing actionpack (3.0.4)

installing mime-types (1.16)

installing polyglot (0.3.1)

installing treetop (1.4.9)

installing mail (2.2.15)

installing actionmailer (3.0.4)

installing arel (2.0.8)

installing activerecord (3.0.4)

installing activeresource (3.0.4)

installing coderay (0.9.7)

installing formtastic (1.2.3)

installing lesstile (1.0.1)

installing ruby-openid (2.1.8)

installing rack-openid (1.2.0)

using bundler (1.0.7)

installing thor (0.14.6)

installing railties (3.0.4)

installing rails (3.0.4)

installing sqlite3 (1.3.3) with native extensions

installing sqlite3-ruby (1.3.3)

installing will_paginate (3.0.pre2)

your bundle is complete! it was installed into ./.bundle/gems/

compiled slug size is 5.4mb

-----> launching... done

deployed to heroku

to [email protected]:sawyer.git

* [new branch] master -> master

success

使用heroku部署專案

1 進入heroku官網 進行註冊。因為heroku是國外的站點,所以需要翻牆。註冊郵箱國內大部分郵箱都不支援,比如說qq郵箱,可以自己申請乙個outlook郵箱。申請後可能會有十分鐘左右的等待期,不要著急為啥沒收到郵件。3 部署專案 拿node舉例 官網上有教程 2 cd進入要部署的專案下 3 輸...

在Heroku上部署MEAN

說明 個人部落格位址為edwardesire.com,歡迎前來品嚐。heroku是國外普遍使用大受好評的paas,支援nodejs,基礎服務 nodejs mongodb 基本都是免費的。搭建mean框架也不怎麼費勁。名字是 hero 和 taiku 俳句 的合體。我們先一起來讀一讀發音 her o...

初次部署django gunicorn nginx

部落格詳細位址 最後,我認為在絕大多數情況下,我們踩過的坑,都是有前人踩過,而且還幫我們填掉了,所以用心找,總能找到答案的。先確認在開發環境下能夠正常訪問 然後一般情況下,在執行python manager.py startproject project之後,目錄應該是這個樣子的 project p...