{"action":"created","issue":{"url":"https://api.github.com/repos/rubytaiwan/AMA/issues/31","labels_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/31/comments","events_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/31/events","html_url":"https://github.com/rubytaiwan/AMA/issues/31","id":109737075,"number":31,"title":"如何在 Ubuntu 14.04 使用 Nginx + Passenger 部署 rails app ?","user":{"login":"AskBear","id":14832915,"avatar_url":"https://avatars.githubusercontent.com/u/14832915?v=3","gravatar_id":"","url":"https://api.github.com/users/AskBear","html_url":"https://github.com/AskBear","followers_url":"https://api.github.com/users/AskBear/followers","following_url":"https://api.github.com/users/AskBear/following{/other_user}","gists_url":"https://api.github.com/users/AskBear/gists{/gist_id}","starred_url":"https://api.github.com/users/AskBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AskBear/subscriptions","organizations_url":"https://api.github.com/users/AskBear/orgs","repos_url":"https://api.github.com/users/AskBear/repos","events_url":"https://api.github.com/users/AskBear/events{/privacy}","received_events_url":"https://api.github.com/users/AskBear/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rubytaiwan/AMA/labels/Deployment","name":"Deployment","color":"001f3f"},{"url":"https://api.github.com/repos/rubytaiwan/AMA/labels/Rails","name":"Rails","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-05T06:09:59Z","updated_at":"2015-10-05T06:53:23Z","closed_at":null,"body":"目前自己嘗試..我先執行了以下指令:\r\n>sudo gem install bundler passenger --no-ri --no-rdoc\r\n>sudo apt-get install libcurl4-openssl-dev\r\n>sudo passenger-install-nginx-module\r\n>wget -O init-deb.sh http://www.linode.com/docs/assets/1139-init-deb.sh\r\n>sudo mv init-deb.sh /etc/init.d/nginx\r\n>sudo chmod +x /etc/init.d/nginx\r\n>sudo /usr/sbin/update-rc.d -f nginx defaults\r\n\r\n然後這時 server start 是成功的。\r\n\r\n接著我將 /opt/nginx/conf/nginx.conf 編輯如下圖:\r\n![deploy4](https://cloud.githubusercontent.com/assets/14832915/10273711/10003b00-6b67-11e5-85c2-7f323533deb0.png)\r\n並執行:\r\n>chmod g+x,o+x /home/rails/deploy/fishing\r\n>RAILS_ENV=production rake db:create\r\n>RAILS_ENV=production rake db:migrate\r\n\r\n最後 restart server..網頁顯示結果如下圖:\r\n![deploy](https://cloud.githubusercontent.com/assets/14832915/10273733/5ab8c518-6b67-11e5-9d99-7f4432a08c4e.png)\r\n\r\n至於 /opt/nginx/logs/error.log 記錄錯誤如下:\r\n![deploy2](https://cloud.githubusercontent.com/assets/14832915/10273741/8b970b22-6b67-11e5-929a-884e6a6c8388.png)\r\n![deploy3](https://cloud.githubusercontent.com/assets/14832915/10273742/8e7908cc-6b67-11e5-8488-fdc8b694b544.png)\r\n\r\n請問這是什麼問題? 我有哪裡要改進的嗎?"},"comment":{"url":"https://api.github.com/repos/rubytaiwan/AMA/issues/comments/145445007","html_url":"https://github.com/rubytaiwan/AMA/issues/31#issuecomment-145445007","issue_url":"https://api.github.com/repos/rubytaiwan/AMA/issues/31","id":145445007,"user":{"login":"timfanda35","id":1924700,"avatar_url":"https://avatars.githubusercontent.com/u/1924700?v=3","gravatar_id":"","url":"https://api.github.com/users/timfanda35","html_url":"https://github.com/timfanda35","followers_url":"https://api.github.com/users/timfanda35/followers","following_url":"https://api.github.com/users/timfanda35/following{/other_user}","gists_url":"https://api.github.com/users/timfanda35/gists{/gist_id}","starred_url":"https://api.github.com/users/timfanda35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timfanda35/subscriptions","organizations_url":"https://api.github.com/users/timfanda35/orgs","repos_url":"https://api.github.com/users/timfanda35/repos","events_url":"https://api.github.com/users/timfanda35/events{/privacy}","received_events_url":"https://api.github.com/users/timfanda35/received_events","type":"User","site_admin":false},"created_at":"2015-10-05T06:53:23Z","updated_at":"2015-10-05T06:53:23Z","body":"請問你的 ruby 是透過 rvm 或是 rbenv 安裝的嗎？"}}