0
votes

I am new to Ruby on Rails. I am trying to learn it and I am working through a Ruby on Rails 3 Tutorial book.

So I created a scaffold for a demo_app and got this:

66-90-244-41:demo_app rodolfopenajr$ rails generate scaffold User name: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

Then next thing I was instructed to do was type the command 'rake db:migrate', but I would get this response...

(in /Users/rodolfopenajr/rails_projects/demo_app)

So I tried to figure out the problem by using 'rake db:migrate --trace' and got the following.

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

(in /Users/rodolfopenajr/rails_projects/demo_app)

** Invoke db:migrate (first_time)

** Invoke environment (first_time)

** Execute environment

** Execute db:migrate

** Invoke db:schema:dump (first_time)

** Invoke environment

** Execute db:schema:dump

I really have no idea what that stuff means or why my rake command isn't working. Can someone help me figure out why the db won't migrate.

Just to note: I have Heroku and Github all set up. Not sure if that is important, but just a FYI.

1
The log that you supplied seems to be from the "rails new demo_app" command and not from the scaffold command. If the scaffold was run correctly you should amongst other things have a file in /db/migrate/ called something create_user. Can you verify if this is correct? - DanneManne
Please indent your rake db:migrate --trace output, including the command itself. - Ryan Bigg
Thanks guys. I haven't had a chance to view the responses but I appreciate the help. Once I get back to this again, I will reply... hopefully with no more questions. - user570104

1 Answers

0
votes

I have the same problem and find that db:migrate:up is failed.

After tracing rails source, it seems that the migrate task cannot handle the path which has links inside, i.e., db:migrate is failed if there are links in your app directory path.

You can try to move your app directory to other folder which has no link in its path.