{"id":20881984,"url":"https://github.com/5xruby/playground5","last_synced_at":"2025-06-19T22:07:39.070Z","repository":{"id":39693389,"uuid":"226519758","full_name":"5xRuby/PlayGround5","owner":"5xRuby","description":"The Virtual Machine allocate system based on Proxmox VE","archived":false,"fork":false,"pushed_at":"2023-01-19T16:18:43.000Z","size":134,"stargazers_count":0,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T17:18:05.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5xRuby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-07T13:41:52.000Z","updated_at":"2020-06-25T09:13:59.000Z","dependencies_parsed_at":"2023-01-28T20:45:57.646Z","dependency_job_id":null,"html_url":"https://github.com/5xRuby/PlayGround5","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/5xRuby/PlayGround5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5xRuby%2FPlayGround5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5xRuby%2FPlayGround5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5xRuby%2FPlayGround5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5xRuby%2FPlayGround5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5xRuby","download_url":"https://codeload.github.com/5xRuby/PlayGround5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5xRuby%2FPlayGround5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260838521,"owners_count":23070606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T07:28:30.600Z","updated_at":"2025-06-19T22:07:34.051Z","avatar_url":"https://github.com/5xRuby.png","language":"Ruby","readme":"Playground5\n===\n\n## 系統需求\n\n* Ruby 2.5.1\n* PostgreSQL 9.6+\n* Node.js 8.0 (以上)\n\n## 環境設定\n\n以下的設定皆以 macOS 為主。\n\n### Homebrew\n\n在 macOS 需要有 [Homebrew](https://brew.sh/index_zh-tw) 來輔助安裝環境。\n\n```bash\n/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\n執行完畢後可以透過 `brew doctor` 確認是否可用。\n\n### Ruby\n\n為了配合多個版本的環境，建議使用 `rbenv` 或者 `rvm` 來管理 Ruby 環境。\n\n```bash\n# 選用 rbenv\nbrew install rbenv\n\n# 選用 rvm\nbrew install rvm\n```\n\n完成後請參考終端機顯示的訊息設定 `.bashrc` 或者其他 Shell 設定檔。\n\n```bash\n# 選用 rbenv\nrbenv install 2.5.1\n\n# 選用 rvm\nrvm install 2.5.1\n```\n\n完成後需要先將 Bundler 安裝到新安裝的 Ruby 環境中（rvm 可能會先預裝完畢）\n\n```bash\n# 先確認是否在正確的 Ruby 版本執行\nruby -v\n# =\u003e ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17]\n\ngem install bundler\n```\n### PostgreSQL\n\n請注意不要直接輸入 `postgresql` 否則會安裝到最新版的 PostgreSQL\n\n```bash\n# 安裝\nbrew install postgresql@9.6\n\n# 啟動伺服器\nbrew services start postgresql@9.6\n```\n\n### Node.js\n\nRails 需要 JavaScript Runtime 一般會使用 Node.js。\n\n```bash\nbrew install node\n\n# 安裝前端套件\nbrew install yarn\n```\n\n### Rails\n\n請先透過 git 將專案下載到本地端。\n\n```bash\n# 切換到專案目錄\ncd Playground5\n\n# 安裝 Rails 所需套件\nbundle install\n\n# 設定 git hook\nbundle exec overcommit --install\n\n# 安裝前端套件\nyarn install\n```\n\nOvercommit 會做以下檢查：\n\n1. commit 前：使用 rubocop 檢查語法\n2. push 前：使用 brakeman 檢查安全性問題\n\n```bash\n# 設定資料庫\nbundle exec rake db:create\n\n# 更新資料庫到最新版\nbundle exec rake db:migrate\n```\n\n## 執行專案\n\n### Rails 伺服器\n\n```bash\n# 這是 rails server 的縮寫\nrails s\n```\n\n開啟後預設可以透過 `http://localhost:3000` 看到網站\n\n#### PendingMigration 錯誤\n\n這是因為最新版本的資料庫已經被更改，但是本機的資料庫還沒有被更新。\n\n```bash\nbundle exec rake db:migrate\n```\n\n執行 `db:migrate` 指令更新資料庫即可。\n\n### 運行測試\n\n這個專案使用 RSpec 進行測試，可以透過執行以下指令運行\n\n```bash\nbundle exec rspec\n```\n\n### Ruby 語法檢查\n\n這個功能會在 commit 前自動執行，必要時可以手動進行\n\n```bash\nbundle exec rubocop\n```\n\n### Ruby 安全性檢查\n\n這個功能會在 push 前自動執行，必要時可以手動進行\n\n```bash\nbundle exec brakeman\n```\n\n### 建立 .env 檔案\n\n建立 `.env` 檔案，並依據 local 開發環境需求修改設定內容。\n\n```bash\ncp .env.example .env\n```\n\n## 部署\n\n這個專案使用 Capistrano 進行部署，請先確定有權限透過 `deployer` 帳號 SSH 到伺服器上。\n\n```bash\ncap [ENV] deploy\n```\n\n假設要部署到測試（Staging）環境，請使用以下指令\n\n```bash\ncap staging deploy\n```\n\n如果是正式環境，則使用以下指令\n\n```bash\ncap production deploy\n```\n\n過程中會詢問要使用的 Git Branch，預設為 master branch，如果需要測試某個 Git Branch 請先將他上傳到 GitHub 上，並且和團隊成員確認後手動輸入 branch 再進行部署跟測試。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5xruby%2Fplayground5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5xruby%2Fplayground5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5xruby%2Fplayground5/lists"}