mysql - Rails 中迁移数据库但未找到表?

标签 mysql ruby-on-rails-3

我正在尝试在 Rails 中迁移数据库,但找不到表。仅使用开发环境,我采取的步骤是通过 Lynda Rails 2010 教程进行的。任何帮助将非常感激。信息如下

NOC-4:app noc$ rake db:migrate
(in /Users/noc/rails_projects/app)
==  CreateUsers: migrating ====================================================
-- create_table(:users)
   -> 0.0566s
==  CreateUsers: migrated (0.0567s) ===========================================

NOC-4:app noc$ mysql -u simple_cms -p simple_cms_development
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.5.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SHOW TABLES
    -> 

下面是我的数据库.yml

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: mysql
  database: simple_cms_development
  username: simple_cms
  password: secretpassword
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be eased and
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: simple_cms_test
  username: simple_cms
  password: 
  pool: 5
  timeout: 5000

production:
  adapter: mysql
  database: simple_cms_development
  username: simple_cms
  password: 
  pool: 5
  timeout: 5000

这也是我需要的 Gemfile 信息

source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'ruby-mysql'
gem 'activerecord'
gem 'mysql'
gem 'rake', '~> 0.8.7'

gem 'therubyracer', :require => 'v8'

最佳答案

老兄,你的分号在哪里?

mysql> show tables;

关于mysql - Rails 中迁移数据库但未找到表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8855437/

相关文章:

ruby-on-rails - Rails 三重连接

mysql - JOIN 两个表返回值,但是当我使用 LEFT JOIN 时,它会返回语法错误

php - 我无法将 PHP 变量传递给 SQL 查询

ruby-on-rails - rails gem Make_flaggable 不保存到数据库

ruby-on-rails-3 - 在哪里最好使用 twitter-bootstrap 编辑 CSS

ruby-on-rails - 需要在 ruby​​ on rails 3 中缩短此表达式

ruby-on-rails - 如何使用 FactoryGirl 发送参数(而不是手动将参数作为散列发送)?

php - Zend 框架基数违规 : 1241 Operand should contain 1 column(s)

mysql 请求 - 寻找不存在的记录

php - 根据 db 中的值在 wp 页脚中动态显示代码