rake db:migrate not working,Mac OS,Rails 3

时间:2011-03-09 01:13:24

标签: ruby-on-rails-3 rake

我是Ruby on Rails的新手。我正在努力学习它,我正在研究Ruby on Rails 3教程书。

所以我为demo_app创建了一个脚手架并得到了这个:

66-90-244-41:demo_app rodolfopenajr $ rails generate scaffold用户名:string email:string

  create  
  create  app/controllers
  create  app/helpers
  create  app/models
  create  app/views/layouts
  create  config/environments
  create  config/initializers
  create  config/locales
  create  db
  create  doc
  create  lib
  create  lib/tasks
  create  log
  create  public/images
  create  public/javascripts
  create  public/stylesheets
  create  script/performance
  create  test/fixtures
  create  test/functional
  create  test/integration
  create  test/performance
  create  test/unit
  create  vendor
  create  vendor/plugins
  create  tmp/sessions
  create  tmp/sockets
  create  tmp/cache
  create  tmp/pids
  create  Rakefile
  create  README
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  config/database.yml
  create  config/routes.rb
  create  config/locales/en.yml
  create  db/seeds.rb
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/new_rails_defaults.rb
  create  config/initializers/session_store.rb
  create  config/environment.rb
  create  config/boot.rb
  create  config/environments/production.rb
  create  config/environments/development.rb
  create  config/environments/test.rb
  create  script/about
  create  script/console
  create  script/dbconsole
  create  script/destroy
  create  script/generate
  create  script/runner
  create  script/server
  create  script/plugin
  create  script/performance/benchmarker
  create  script/performance/profiler
  create  test/test_helper.rb
  create  test/performance/browsing_test.rb
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/index.html
  create  public/favicon.ico
  create  public/robots.txt
  create  public/images/rails.png
  create  public/javascripts/prototype.js
  create  public/javascripts/effects.js
  create  public/javascripts/dragdrop.js
  create  public/javascripts/controls.js
  create  public/javascripts/application.js
  create  doc/README_FOR_APP
  create  log/server.log
  create  log/production.log
  create  log/development.log
  create  log/test.log

接下来我被指示要做的就是输入命令'rake db:migrate',但我会得到这个回复......

(在/ Users / rodolfopenajr / rails_projects / demo_app中)

所以我试图通过使用'rake db:migrate --trace'找出问题,并得到以下结果。

66-90-244-41:demo_app rodolfopenajr $ rake db:migrate --trace

(在/ Users / rodolfopenajr / rails_projects / demo_app中)

**调用db:migrate(first_time)

**调用环境(first_time)

**执行环境

**执行db:migrate

**调用db:schema:dump(first_time)

**调用环境

**执行db:schema:dump

我真的不知道那些东西意味着什么或为什么我的rake命令不起作用。有人可以帮我弄清楚为什么数据库不会迁移。

请注意:我已经设置了Heroku和Github。不确定这是否重要,但只是一个FYI。

1 个答案:

答案 0 :(得分:0)

我遇到同样的问题,发现db:migrate:up失败。

跟踪rails源后,似乎迁移任务无法处理内部有链接的路径,例如,如果您的应用程序目录路径中有链接,则db:migrate失败。

您可以尝试将您的app目录移动到其路径中没有链接的其他文件夹。