简体   繁体   English

无法将在MySQL上运行的ruby on rails应用程序连接到Heroku

[英]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.

相关问题 无法在Ruby on Rails中连接到MySQL - Can't connect to MySQL in Ruby on Rails 使用mysql数据库将Ruby on Rails应用程序部署到Heroku - Deploy Ruby on Rails App to Heroku with mysql database 我无法通过Rails连接到远程mysql服务器 - I can't connect to a remote mysql server through ruby on rails 无法将Ruby on Rails连接到远程mysql数据库 - Can't connect Ruby on Rails to remote mysql database 无法将Ruby on Rails App与Mysql连接 - Cannot connect Ruby on Rails App with Mysql Ruby on Rails无法使用MySQL创建/使用应用 - Ruby on Rails can't create/use an app using MySQL Rails:Heroku CI:Mysql2 :: Error:无法连接到“ 127.0.0.1”(111)上的MySQL服务器以进行测试环境 - Rails : Heroku CI : Mysql2::Error: Can't connect to MySQL server on '127.0.0.1' (111) for test env Ruby on Rails-Mysql2 :: Error:无法连接到“ localhost”上的MySQL服务器(10061) - Ruby on Rails - Mysql2::Error: Can't connect to MySQL server on 'localhost' (10061) Ruby on Rails 3 无法通过 OSX 上的套接字“/tmp/mysql.sock”连接到本地 MySQL 服务器 - Ruby on Rails 3 Can't connect to local MySQL server through socket '/tmp/mysql.sock' on OSX 在为Ruby on Rails应用程序设置mysql数据库时出现“无法通过套接字连接到本地MySQL服务器'/var/run/mysqld/mysqld.sock'”错误 - Getting “Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'” error when setting up mysql database for Ruby on Rails app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM