PostgreSQL & DataMapper issues

jbk

Been scratching my head for a while on this one and despite trying many variations I cannot see the mistake. After writing the app file, which contains what looks like the correct DataMapper.setup code for using PostgreSQL (?), and upon trying to play around in IRB/PRY, i just get a 'FATAL database not created' message even after i have called 'Song.auto_migrate!', here is my code, can anyone help me get past this? Thanks in advance:

require 'data_mapper'
require 'dm-core' #main DataMapper gem
require 'dm-migrations' #extra DataMapper functionality extension

DataMapper.setup(:default, "postgres://localhost/development")

class Song

  include DataMapper::Resource
  property :id, Serial
  property :title, String
  property :lyrics, Text
  property :length, Integer
  property :released_on, Date
end

DataMapper.finalize

I require the file all fine in irb, then call Song.auto_migrate! and it runs the 'database does not exist' error. What am i doing wrong?

codepreneur

You need to do this in command line:

psql

and then

CREATE DATABASE development;

before even trying to run Data Mapper setup code.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create empty Postgresql database with Datamapper

From Dev

Caching issues with django or postgresql

From Dev

PostgreSQL concurrent transaction issues

From Dev

PostgreSQL Trigger creation issues

From Dev

Datamapper into String

From Dev

Spark SQL - PostgreSQL JDBC Classpath Issues

From Dev

Facing issues with sqlalchemy+postgresql session management

From Dev

Collection Query Issues with QueryDSL JPA and PostgreSQL

From Dev

Tracking out of database connection issues with Python and PostgreSQL

From Dev

Collection Query Issues with QueryDSL JPA and PostgreSQL

From Dev

PHP DataMapper and OOP Design

From Dev

Mule DataMapper IOException

From Dev

Mule datamapper nested array

From Dev

DataMapper Self Referential Model

From Dev

Datamapper not saving records to MySQL

From Dev

PostgreSQL: out of memory issues with array_agg() on a heroku db server

From Dev

PostgreSQL to H2 engine: Data source setup issues

From Dev

Package dependency issues with postgresql-9.4-postgis-2.1

From Dev

postgresql regex grouping + casting issues when extracting price text

From Dev

postgresql regex grouping + casting issues when extracting price text

From Dev

Updating a property set as the key in DataMapper

From Dev

mule DataMapper vs groovy or similar

From Dev

validate fields in datamapper (CSV to JSON).

From Dev

Slow Ruby DataMapper.setup

From Dev

Need to define an alias for a DataMapper property

From Dev

DataMapper many-to-many association

From Dev

CodeIgniter DataMapper ORM memory issue

From Dev

mule DataMapper vs groovy or similar

From Dev

DataMapper: one-to-many relationship with custom name?

Related Related

HotTag

Archive