0
我剛剛在EC2上部署了帶有橡膠的rails應用程序。此外,還爲數據庫創建了RDS實例。運行無法連接到服務器EC2中部署了rails應用程序後使用橡膠
$ cat /etc/host
獲得對生產的橡膠作爲配置
但是,當我瀏覽http://web01.musemebackend.com/admin/login,我得到的錯誤「504網關超時,服務器沒有及時響應」
錯誤日誌中的apache2示出:
[ pid=1813 thr=12161140 file=utils.rb:176 time=2013-03-06 20:49:28.175 ]:
*** Exception PhusionPassenger::UnknownError in PhusionPassenger::Rack::ApplicationSpawner (Can't connect to MySQL server on 'musemedb.cfmz4gvshyts.us-east-1.rds.amazonaws.com' (110) (Mysql2::Error)) (process 1813, thread #<Thread:0x000000017320e8>):
正如我修改的配置/ database.yml中:
production:
adapter: mysql2
encoding: utf8
database: muse_me_backend_production
username: app_admin
password: MYPASSWORD
host: musemedb.cfmz4gvshyts.us-east-1.rds.amazonaws.com
port: 3306
改性配置/橡膠/橡膠mysql.yml爲:
# REQUIRED: The credentials for creating/accessong your app's database
#
db_user: app_admin
db_pass: MYPASSWORD
db_name: muse_me_backend_production
db_host: musemedb.cfmz4gvshyts.us-east-1.rds.amazonaws.com
和配置/橡膠/普通/ database.yml中作爲
<%
@path = "#{Rubber.root}/config/database.yml"
%>
<%= Rubber.env %>:
adapter: <%= YAML::load(File.open("#{Rubber.root}/config/database.yml"))["production"]["adapter"] %>
encoding: utf8
database: <%= rubber_env.db_name %>
username: <%= rubber_env.db_user %>
password: <%= rubber_env.db_pass %>
host: <%= rubber_env.db_host %>
pool: 5
該應用程序應被成功部署。數據庫遷移也會成功完成。有什麼我錯過了連接服務器?我需要擁有musemebackend.com的域名嗎?現在我不擁有它。我在教程中看到它只是foo.com。這很重要嗎?
感謝