[PostgreSQL] pg bundle install error

在 deploy 時 bundle install 報了這個錯誤 checking for pg_config... yes Using config values from /usr/bin/pg_config You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application. You need »

[Docker] install docker on mac

到 docker hub 下載 .dmg 檔 雙擊 Docker.dmg, 把鯨魚拉到 Applications 檢查是否都安裝完成 $ docker --version Docker version 18.09.2, build 6247962 $ docker-compose --version docker-compose version 1.23.2, build 1110ad01 $ docker-machine --version docker-machine version 0 »

[Rails] Railtie

初探 Railtie Railtie 為 Rails 與其他 component 提供了整合的接口, Rails::Application 繼承 Engine, Engine 又繼承 Railtie Rails 透過 Railtie 讀取 configurations, 建立 application 以及連接各個不同的 component (如: Active Record, Action View, Action Controller, Action Mailer), 使他們可以建立自己 »

[Source code] ActiveSupport::LazyLoadHooks

最近在看 Railtie, 在 initializer 的部分時, 翻了很多 source code 對裡面的 ActiveSupport.on_load 感到好奇 on_load 是 ActiveSupport::LazyLoadHooks 內的一個方法 可以使 component 延遲載入, 而不是在啟動時就全部載入 對 rails app 提升速度很有幫助 從 source code 可以看到一開始定義了三個 hash 的 instance variable @load_hooks, »

[Ruby] rbenv bundle 問題

最近改用 rbenv, 在專案下 bundle 時遇到以下問題 rbenv: bundle: command not found The `bundle' command exists in these Ruby versions: 2.1.2 2.1.5 2.1.8 2.2.1 2.2.8 2.3.3 2.5.3 解決方法: 看目前 Gemfile.lock 裡面 bundle 的版本 $ cat Gemfile.lock | grep -A 1 "BUNDLED »