heroku db:在ubuntu中无法连接到我的数据库 [英] heroku db:pull cant connect to my DB in ubuntu
问题描述
heroku db:pull
来拉取数据库并将其导入到我的mysql数据库中,但是我继续收到此错误: 无法连接到数据库:
Sequel :: AdapterNotFound - > LoadError:没有这样的文件加载 - mysql2
我的gem文件有 gem 'mysql2','< 0.3'
和我的宝石已经通过RVM安装了水龙头。我从来没有遇到这个问题,当我跑db时:之前拉,所以我不知道问题是什么。
使用rails 3.0运行ruby 1.9.2
运行:
$ b gem install mysql2
than heroku db:pull
again ...
如果您在之前的gem install mysql2中遇到此错误:
构建原生扩展。这可能需要一段时间...
错误:安装mysql2时出错:
错误:无法构建gem本机扩展。
可能需要安装libmysqlclient-dev软件包:
sudo apt-get install mysql-server mysql-server-5.1 libmysqlclient-dev mysql-client-5.1 mysql-common
than
gem install mysql2
...或最终运行
locate mysql_config
然后在下面的命令路径中替换生成的路径:
sudo gem安装mysql - --with-mysql-config = / usr / local / mysql / bin / mysql_config
So I recently updated ubuntu to 11.04 and then downgraded back to 11.04 because I hated unity. Anyway, after I reinstalled 11.40 I had to clone all my old heroku apps and tried to run heroku db:pull
to pull the DB and have it imported into my mysql db but I keep getting this error:
Failed to connect to database:
Sequel::AdapterNotFound -> LoadError: no such file to load -- mysql2
my gem file has gem 'mysql2', '< 0.3'
and I gem installed taps already via RVM. I never had this issue when I ran db:pull before so I dont know what the problem is.
Im running ruby 1.9.2 with rails 3.0
run :
gem install mysql2
than heroku db:pull
again ...
if you get this error with the previous "gem install mysql2" :
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
probably libmysqlclient-dev package should be installed :
sudo apt-get install mysql-server mysql-server-5.1 libmysqlclient-dev mysql-client-5.1 mysql-common
than
gem install mysql2
... or eventually run
locate mysql_config
then replace the resulting path, with in the following command path :
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
这篇关于heroku db:在ubuntu中无法连接到我的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!