此專案在lib/tasks中編寫一個rake檔來運行Python的爬蟲
Learn More →
在根目錄添加檔案runtime.txt,寫入要運行的Python版本,這裡依照本機安裝的3.9.1
Learn More →
在根目錄添加檔案requirements.txt,裡面寫上所需要安裝的Python套件
Learn More →
web:gunicorn my_app_name:app
$ heroku run rake 你的rake檔案
Learn More →
在Heroku要同時運行不同的語言需要建立不同的buildpack,用$ heroku buildpacks
,可以看到現在專案只有ruby的buildpack
Learn More →
增加一個Python的buildpack,依照官網表示主要運作程式語言的buildpack要放在最後一項
$ heroku buildpacks:add --index 1 heroku/python
Learn More →
建立buildpack後要重新push一次,就可以看到正在安裝Python與套件
Learn More →
檢查方式,在postcss.config.js中註解掉 if (process.env.RAILS_ENV === 'production') {} 這樣可以將本機的開發環境變成與線上部署的運作環境相同 './app/**/**/*.html.erb' './app/**/*.scss'
Jan 26, 2021Active Storage 可以支援各種後端服務(如 AWS S3),為 Active Record 模型提供檔案上傳和附件功能。 前置作業 先建立一個新專案來測試 $ rails new project_name 為專案安裝Active Storage功能,會在資料庫中建立兩個名為 active_storage_blobs 和 active_storage_attachments 的資料表 $ rails active_storage:install 用scaffold建立一個用來上傳的model取名為Upload $ rails generate scaffold Upload
Jan 26, 2021The data directory contains an old postmaster.pid file $ cd Library/Application\ Support/Postgres $ cd var-13 $ ls $ rm postmaster.pid
Jan 26, 2021<table> <caption>表格標題</caption>#每個table只有一個caption宣告 <thead> #表頭標籤 <tr> <th>預設粗體</th> #表頭單元 </tr> </thead> <tbody> #中間資料標籤 <tr> <td>資料</td> #資料內容
Jan 26, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up