尝试rake db:migrate时未在Rails项目中选择数据库 [英] Database not being selected in rails project when attempting to rake db:migrate
问题描述
使用Rails应用程序时,出现某种奇怪的数据库/rake问题.
Working with a rails app, having some manner of weird database / rake issues.
执行时:
rake db:migrate
我遇到以下错误:
Mysql2::Error: No database selected: SHOW TABLES
(See full trace by running task with --trace)
跟踪没有显示很多有用的信息.可以在此处看到: http://pastebin.com/WdsguudC
The trace isn't revealing much useful information. Can be seen here: http://pastebin.com/WdsguudC
配置文件看起来正确,并且用户正在登录,否则我将遇到某种访问错误.数据库存在,用户具有正确的权限,我可以手动访问和操作它.我做了很多谷歌搜索,但没有发现任何帮助.不确定是否需要提供其他代码,因为这似乎是一个相当低级的问题.
The config file looks right, and the user is getting logged in, or I would have gotten some kind of access error. The database exists, the user has correct permission, and I can access and manipulate it manually. I have done a bunch of googling, and haven't found anything helpful. Not sure if there is any other code that needs provided, because this seems like fairly low level problem.
推荐答案
毕竟是Yaml中的间距问题.
after all that it was a spacing issue in the yaml.
这篇关于尝试rake db:migrate时未在Rails项目中选择数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!