Hi Folks,  I'm new to DataMapper and it looks good.  I'm trying to get
started with a Rails 3 application and stubbed my toe early in the
process.  I followed the instructions on http://github.com/datamapper/dm-rails
but "rake db:setup" doesn't generate any sqlite databases despite
messages indicating it did.  If I pin Gemfile's DM_VERSION to '=1.0.0'
everything works closer to how I expect - my development database is
created, but not the test db (even though a message indicates that it
should have been).  1.0.1 or 1.0.2 work the same - no databases are
created.

I'm willing to dig into it but would appreciate any tips.  Anybody got
any ideas about what might have changed between 1.0.0 and 1.0.1 that
could cause this?

Thanks, Toby

Here's the log of what I tried:

to...@interim:~/work$ rvm list

rvm rubies

   ruby-1.8.7-p302 [ i386 ]

to...@interim:~/work$ rvm default ruby-1.8.7
to...@interim:~/work$ gem install rails
Successfully installed activesupport-3.0.1
Successfully installed builder-2.1.2
Successfully installed i18n-0.4.1
Successfully installed activemodel-3.0.1
Successfully installed rack-1.2.1
Successfully installed rack-test-0.5.6
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.23
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.1
Successfully instal\led arel-1.0.1
Successfully installed activerecord-3.0.1
Successfully installed activeresource-3.0.1
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.8
Successfully installed mail-2.2.7
Successfully installed actionmailer-3.0.1
Successfully installed thor-0.14.3
Successfully installed railties-3.0.1
Successfully installed rails-3.0.1
22 gems installed
Installing ri documentation for activesupport-3.0.1...
Installing ri documentation for builder-2.1.2...
ERROR:  While generating documentation for builder-2.1.2
... MESSAGE:   Unhandled special: Special: type=17, text="<!-- HI -->"
... RDOC args: --ri --op /home/tobyc/.rvm/gems/ruby-1.8.7-p302/doc/
builder-2.1.2/ri --title Builder -- Easy XML Building --main README --
line-numbers --quiet lib CHANGES Rakefile README doc/releases/
builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/
builder-2.1.1.rdoc --title builder-2.1.2 Documentation
(continuing with the rest of the installation)
Installing ri documentation for i18n-0.4.1...
Installing ri documentation for activemodel-3.0.1...
Installing ri documentation for rack-1.2.1...
Installing ri documentation for rack-test-0.5.6...
Installing ri documentation for rack-mount-0.6.13...
Installing ri documentation for tzinfo-0.3.23...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.1...
Installing ri documentation for arel-1.0.1...
Installing ri documentation for activerecord-3.0.1...
Installing ri documentation for activeresource-3.0.1...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.1...
Installing ri documentation for treetop-1.4.8...
Installing ri documentation for mail-2.2.7...
Installing ri documentation for actionmailer-3.0.1...
Installing ri documentation for thor-0.14.3...
Installing ri documentation for railties-3.0.1...
Installing ri documentation for rails-3.0.1...
File not found: lib
to...@interim:~/work$ rails new pit_out -m 
http://datamapper.org/templates/rails.rb
      create
      create  README
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/models
      create  app/mailers
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/test.rb
      create  config/environments/production.rb
      create  config/environments/development.rb
      create  config/initializers
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/inflections.rb
      create  config/initializers/session_store.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  log
      create  log/server.log
      create  log/production.log
      create  log/development.log
      create  log/test.log
      create  public
      create  public/422.html
      create  public/404.html
      create  public/500.html
      create  public/index.html
      create  public/robots.txt
      create  public/favicon.ico
      create  public/images
      create  public/images/rails.png
      create  public/stylesheets
      create  public/stylesheets/.gitkeep
      create  public/javascripts
      create  public/javascripts/prototype.js
      create  public/javascripts/application.js
      create  public/javascripts/controls.js
      create  public/javascripts/rails.js
      create  public/javascripts/effects.js
      create  public/javascripts/dragdrop.js
      create  script
      create  script/rails
      create  test
      create  test/test_helper.rb
      create  test/performance/browsing_test.rb
      create  test/fixtures
      create  test/functional
      create  test/integration
      create  test/unit
      create  tmp
      create  tmp/sessions
      create  tmp/sockets
      create  tmp/cache
      create  tmp/pids
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
       apply  http://datamapper.org/templates/rails.rb
       apply    http://datamapper.org/templates/rails/gemfile.rb
      remove      Gemfile
      create      Gemfile
       apply    http://datamapper.org/templates/rails/application.rb
       apply      http://datamapper.org/templates/rails/config.rb
        gsub        config/application.rb
        gsub        config/environments/development.rb
        gsub        config/environments/test.rb
       apply      http://datamapper.org/templates/rails/database.yml.rb
      remove        config/database.yml
      create        config/database.yml
      inject      app/controllers/application_controller.rb
      inject      app/controllers/application_controller.rb
 initializer      jruby_monkey_patch.rb

 
---------------------------------------------------------------------------
    Edit your Gemfile (do not forget to run 'bundle install' after
doing that)
    Some of the following commands assume that you passed the --
binstubs option
    to bundle install. If you haven't done so, use 'bundle exec rake'
where the
    examples below use './bin/rake'
 
---------------------------------------------------------------------------
    If you want to use rspec for testing, you first need to uncomment
the line
    that declares it in the Gemfile. The you need to run 'bundle
install' again
    Once that's done, you need to actually install it into your app
and update
    your spec_helper as shown in the dm-rails README
 
---------------------------------------------------------------------------
    Install rspec (optional):             rails g rspec:install
    Have a look at the dm-rails README:   http://github.com/datamapper/dm-rails
 
---------------------------------------------------------------------------
    Have a look at available rake tasks:  ./bin/rake -T
    Generate a simple scaffold:           rails g scaffold Person
name:string
    Create, automigrate and seed the DB:  ./bin/rake db:setup
    Start the server:                     rails server
 
---------------------------------------------------------------------------
    After the sever booted, point your browser at http://localhost:3000/people
 
---------------------------------------------------------------------------

to...@interim:~/work$ cd pit_out/
to...@interim:~/work/pit_out$ bundle install
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.1)
Using builder (2.1.2)
Using i18n (0.4.1)
Using activemodel (3.0.1)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.1)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.8)
Using mail (2.2.7)
Using actionmailer (3.0.1)
Installing addressable (2.2.2)
Installing data_objects (0.10.2)
Installing extlib (0.9.15)
Installing dm-core (1.0.2)
Installing dm-active_model (1.0.2)
Installing dm-aggregates (1.0.2)
Installing dm-migrations (1.0.2)
Installing dm-constraints (1.0.2)
Installing dm-do-adapter (1.0.2)
Installing dm-observer (1.0.2)
Using thor (0.14.3)
Using railties (3.0.1)
Installing dm-rails (1.0.3)
Installing do_sqlite3 (0.10.2) with native extensions
Installing dm-sqlite-adapter (1.0.2)
Installing dm-timestamps (1.0.2)
Installing dm-transactions (1.0.2)
Installing fastercsv (1.5.3)
Installing json_pure (1.4.6)
Installing stringex (1.1.0)
Installing uuidtools (2.1.1)
Installing dm-types (1.0.2)
Installing dm-validations (1.0.2)
Using bundler (1.0.3)
Your bundle is complete! It was installed into /home/tobyc/.rvm/gems/
ruby-1.8.7-p302
to...@interim:~/work/pit_out$ rails g scaffold Person name:string
      invoke  data_mapper
      create    app/models/person.rb
       route  resources :people
      invoke  scaffold_controller
      create    app/controllers/people_controller.rb
      invoke    erb
      create      app/views/people
      create      app/views/people/index.html.erb
      create      app/views/people/edit.html.erb
      create      app/views/people/show.html.erb
      create      app/views/people/new.html.erb
      create      app/views/people/_form.html.erb
      invoke    helper
      create      app/helpers/people_helper.rb
      invoke  stylesheets
      create    public/stylesheets/scaffold.css
to...@interim:~/work/pit_out$ rake db:setup
(in /home/tobyc/work/pit_out)
[datamapper] Created database 'pit_out_development.db'
[datamapper] Created database 'pit_out_test.db'
[datamapper] Finished auto_migrate! for :default repository
'pit_out_development.db'
to...@interim:~/work/pit_out$ ls
app     config.ru  doc      Gemfile.lock  log     Rakefile  script
tmp
config  db         Gemfile  lib           public  README    test
vendor
to...@interim:~/work/pit_out$ ls db
seeds.rb
to...@interim:~/work/pit_out$ rails server
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-10-20 17:21:21] INFO  WEBrick 1.3.1
[2010-10-20 17:21:21] INFO  ruby 1.8.7 (2010-08-16) [i686-linux]
[2010-10-20 17:21:27] INFO  WEBrick::HTTPServer#start: pid=19351
port=3000


Started GET "/people" for 127.0.0.1 at Wed Oct 20 17:21:47 -0400 2010
  Processing by PeopleController#index as HTML
  SQL (0.393ms)  SELECT "id", "name" FROM "people" ORDER BY "id"
no such table: people (code: 1, sql state: , query: SELECT "id",
"name" FROM "people" ORDER BY "id", uri: sqlite3://)
Rendered people/index.html.erb within layouts/application (7.8ms)
Completed   in 14ms

ActionView::Template::Error (no such table: people):
    8:     <th></th>
    9:   </tr>
    10:
    11: <% @people.each do |person| %>
    12:   <tr>
    13:     <td><%= person.name %></td>
    14:     <td><%= link_to 'Show', person %></td>
  app/views/people/index.html.erb:11:in
`_app_views_people_index_html_erb___523918671__616350428_0'
  app/controllers/people_controller.rb:7:in `index'

Rendered /home/tobyc/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/
lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
Rendered /home/tobyc/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/
lib/action_dispatch/middleware/templates/rescues/
_request_and_response.erb (5.0ms)
Rendered /home/tobyc/.rvm/gems/ruby-1.8.7-p302/gems/actionpack-3.0.1/
lib/action_dispatch/middleware/templates/rescues/template_error.erb
within rescues/layout (12.0ms)

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to