[英]Can't connect my ruby on rails app running on MySQL to heroku
I am trying to deploy a rails app to Heroku for the first time. 我正在尝试第一次将Rails应用程序部署到Heroku。 I am trying to connect my ruby on rails app which has a MySQL database.
我正在尝试连接具有MySQL数据库的Rails应用程序上的ruby。 I am not sure if I have missed out on some steps but whenever I try to access heroku's provided url, I get the message "We're sorry, but something went wrong."
我不确定是否错过了某些步骤,但是每当我尝试访问heroku提供的url时,都会收到消息“很抱歉,出现了问题”。 and it asks to check the logs.
并要求检查日志。
When I check Heroku logs, what I can make out of it is I see something like 当我检查Heroku日志时,我可以看到的是
ActionView::Template::Error (Access denied for user 'adffdadf2341'@'ip-10-187-29-34.ec2.internal' (using password: YES)):
I have created a ClearDB add on and I've set the following 我创建了一个ClearDB附加组件,并设置了以下内容
CLEARDB_DATABASE_URL: mysql2://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/heroku_db?reconnect=true
I've set this to DATABASE_URL as well.
I'm not sure if all my config files or database.yml are as it should be. 我不确定我所有的配置文件或database.yml是否都应该是正确的。 Also things to note are I am using gems like Paperclip and Devise.To make sure my Paperclip works properly I am using AWS.
另外要注意的是我正在使用Paperclip和Devise之类的宝石。为确保我的Paperclip正常工作,我正在使用AWS。
My github repo is on the following https://github.com/esjayrockz/Savour 我的github存储库位于以下https://github.com/esjayrockz/Savour
Can you please check this and say if I'm missed out on anything. 能否请您检查一下并说出我是否有任何遗漏。
Password is wrong for the user so cannot connect to the MySQL DB. 用户密码错误,因此无法连接到MySQL数据库。 Try these commands in your console:
在控制台中尝试以下命令:
mysql -u root -p
And when prompted, give the password as 'admin' 并在出现提示时,将密码输入为“ admin”
If this is possible, then you should be good to go. 如果有可能,那么您应该很好。
Heroku仅与postgres数据库一起使用,因此从gemfile中删除mysql并添加以下行:
gem 'pg'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.