jipiboily / monologue

Monologue is a basic blogging engine. It is a Rails mountable engine you can mount in your already existing Rails app, or a in a new one! Enjoy.
http://jipiboily.com/2013/monologue-0-3-0-released-and-monologue-markdown
MIT License
477 stars 194 forks source link

Ruby 2.1.1 Rails 4.1 Postgresql + Monologue Migration error #207

Closed xxxazxxx closed 10 years ago

xxxazxxx commented 10 years ago

Seems like it is referencing a Post model which isn't existing. Do we have to create it? If yes what are the keys/attributes for the Post Model.

Gemfile :
gem 'monologue', github: 'jipiboily/monologue'

Routes : mount Monologue::Engine, at: '/blog'

Postgresql

➜  tgl git:(issue-2-scaffold) ✗ bundle exec rake monologue:install:migrations

  SafeYAML Warning
  ----------------

  You appear to have an outdated version of libyaml (0.1.4) installed on your system.

  Prior to 0.1.6, libyaml is vulnerable to a heap overflow exploit from malicious YAML payloads.

  For more info, see:
  https://www.ruby-lang.org/en/news/2014/03/29/heap-overflow-in-yaml-uri-escape-parsing-cve-2014-2525/

  The easiest thing to do right now is probably to update Psych to the latest version and enable
  the 'bundled-libyaml' option, which will install a vendored libyaml with the vulnerability patched:

  gem install psych -- --enable-bundled-libyaml

Copied migration 20140801070240_create_monologue_users.monologue.rb from monologue
Copied migration 20140801070241_create_monologue_posts_revisions.monologue.rb from monologue
Copied migration 20140801070242_create_monologue_posts.monologue.rb from monologue
Copied migration 20140801070243_create_monologue_tags.monologue.rb from monologue
Copied migration 20140801070244_join_posts_and_tags.monologue.rb from monologue
Copied migration 20140801070245_migrate_old_urls.monologue.rb from monologue
Copied migration 20140801070246_add_index_to_posts_revision_url.monologue.rb from monologue
Copied migration 20140801070247_rename_post_tags_table.monologue.rb from monologue
Copied migration 20140801070248_create_taggings.monologue.rb from monologue
Copied migration 20140801070249_delete_join_posts_tags.monologue.rb from monologue
Copied migration 20140801070250_add_index_to_tag_name.monologue.rb from monologue
Copied migration 20140801070251_move_user_id_to_post.monologue.rb from monologue
Copied migration 20140801070252_merge_revisions_into_posts.monologue.rb from monologue
➜  tgl git:(issue-2-scaffold) ✗ rake db:migrate                              
  ActiveRecord::SchemaMigration Load (1.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"
Migrating to CreateMonologueUsers (20140801070240)
   (0.7ms)  BEGIN
== 20140801070240 CreateMonologueUsers: migrating =============================
-- create_table(:monologue_users)
   (111.5ms)  CREATE TABLE "monologue_users" ("id" serial primary key, "name" character varying(255), "email" character varying(255), "password_digest" character varying(255), "created_at" timestamp, "updated_at" timestamp) 
   -> 0.1174s
== 20140801070240 CreateMonologueUsers: migrated (0.1178s) ====================

  SQL (1.0ms)  INSERT INTO "schema_migrations" ("version") VALUES ($1)  [["version", "20140801070240"]]
   (28.2ms)  COMMIT
Migrating to CreateMonologuePostsRevisions (20140801070241)
   (0.8ms)  BEGIN
== 20140801070241 CreateMonologuePostsRevisions: migrating ====================
-- create_table(:monologue_posts_revisions)
   (2.0ms)          SELECT f.conname, pg_get_constraintdef(f.oid), t.relname
          FROM pg_class t, pg_constraint f
         WHERE f.conrelid = t.oid
           AND f.contype = 'f'
           AND t.relname = 'monologue_posts_revisions'
           AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )

   (1.8ms)          SELECT f.conname, pg_get_constraintdef(f.oid), t.relname
          FROM pg_class t, pg_constraint f
         WHERE f.conrelid = t.oid
           AND f.contype = 'f'
           AND t.relname = 'monologue_posts_revisions'
           AND t.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )

   (135.5ms)  CREATE TABLE "monologue_posts_revisions" ("id" serial primary key, "title" character varying(255), "content" text, "url" character varying(255), "user_id" integer, "post_id" integer, "published_at" timestamp, "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY ("post_id") REFERENCES "posts" ("id")) 
PG::UndefinedTable: ERROR:  relation "posts" does not exist
: CREATE TABLE "monologue_posts_revisions" ("id" serial primary key, "title" character varying(255), "content" text, "url" character varying(255), "user_id" integer, "post_id" integer, "published_at" timestamp, "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY ("post_id") REFERENCES "posts" ("id")) 
   (0.7ms)  ROLLBACK
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedTable: ERROR:  relation "posts" does not exist
: CREATE TABLE "monologue_posts_revisions" ("id" serial primary key, "title" character varying(255), "content" text, "url" character varying(255), "user_id" integer, "post_id" integer, "published_at" timestamp, "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY ("post_id") REFERENCES "posts" ("id")) /home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `block in ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/transactions.rb:208:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
-e:1:in `<main>'
ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation "posts" does not exist
: CREATE TABLE "monologue_posts_revisions" ("id" serial primary key, "title" character varying(255), "content" text, "url" character varying(255), "user_id" integer, "post_id" integer, "published_at" timestamp, "created_at" timestamp, "updated_at" timestamp, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY ("user_id") REFERENCES "users" ("id"), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY ("post_id") REFERENCES "posts" ("id")) 
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `block in ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/transactions.rb:208:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
-e:1:in `<main>'
PG::UndefinedTable: ERROR:  relation "posts" does not exist
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `block in ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `block in transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:219:in `within_new_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/database_statements.rb:211:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/transactions.rb:208:in `transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1038:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `block in load'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in `load_dependency'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in `load'
-e:1:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
➜  tgl git:(issue-2-scaffold) ✗

MySQL

➜  tgl git:(issue-2-scaffold) ✗ rake db:migrate
Migrating to CreateMonologueUsers (20140801070240)
== 20140801070240 CreateMonologueUsers: migrating =============================
-- create_table(:monologue_users)
   (308.6ms)  CREATE TABLE `monologue_users` (`id` int(11) auto_increment PRIMARY KEY, `name` varchar(255), `email` varchar(255), `password_digest` varchar(255), `created_at` datetime, `updated_at` datetime) ENGINE=InnoDB
   -> 0.3106s
== 20140801070240 CreateMonologueUsers: migrated (0.3108s) ====================

   (0.2ms)  BEGIN
  SQL (0.4ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20140801070240')
   (0.3ms)  COMMIT
Migrating to CreateMonologuePostsRevisions (20140801070241)
== 20140801070241 CreateMonologuePostsRevisions: migrating ====================
-- create_table(:monologue_posts_revisions)
   (0.8ms)  SHOW CREATE TABLE `monologue_posts_revisions`
Mysql2::Error: Table 'tgl_development.monologue_posts_revisions' doesn't exist: SHOW CREATE TABLE `monologue_posts_revisions`
   (0.6ms)  SHOW CREATE TABLE `monologue_posts_revisions`
Mysql2::Error: Table 'tgl_development.monologue_posts_revisions' doesn't exist: SHOW CREATE TABLE `monologue_posts_revisions`
   (444.3ms)  CREATE TABLE `monologue_posts_revisions` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255), `content` text, `url` varchar(255), `user_id` int(11), `post_id` int(11), `published_at` datetime, `created_at` datetime, `updated_at` datetime, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)) ENGINE=InnoDB
Mysql2::Error: Can't create table 'tgl_development.monologue_posts_revisions' (errno: 150): CREATE TABLE `monologue_posts_revisions` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255), `content` text, `url` varchar(255), `user_id` int(11), `post_id` int(11), `published_at` datetime, `created_at` datetime, `updated_at` datetime, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)) ENGINE=InnoDB
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: Can't create table 'tgl_development.monologue_posts_revisions' (errno: 150): CREATE TABLE `monologue_posts_revisions` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255), `content` text, `url` varchar(255), `user_id` int(11), `post_id` int(11), `published_at` datetime, `created_at` datetime, `updated_at` datetime, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)) ENGINE=InnoDB/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `query'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:458:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `eval'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `<main>'
ActiveRecord::StatementInvalid: Mysql2::Error: Can't create table 'tgl_development.monologue_posts_revisions' (errno: 150): CREATE TABLE `monologue_posts_revisions` (`id` int(11) auto_increment PRIMARY KEY, `title` varchar(255), `content` text, `url` varchar(255), `user_id` int(11), `post_id` int(11), `published_at` datetime, `created_at` datetime, `updated_at` datetime, CONSTRAINT fk_monologue_posts_revisions_user_id FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), CONSTRAINT fk_monologue_posts_revisions_post_id FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`)) ENGINE=InnoDB
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `query'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:458:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `eval'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `<main>'
Mysql2::Error: Can't create table 'tgl_development.monologue_posts_revisions' (errno: 150)
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `query'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `block in execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:373:in `block in log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activesupport-4.1.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_adapter.rb:367:in `log'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:301:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/mysql2_adapter.rb:228:in `execute'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:205:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/schema_plus-1.5.0/lib/schema_plus/active_record/connection_adapters/schema_statements.rb:37:in `create_table_with_schema_plus'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:458:in `create_table'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:649:in `block in method_missing'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `block in say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:621:in `say_with_time'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:641:in `method_missing'
/home/admin/ror/tgl/db/migrate/20140801070241_create_monologue_posts_revisions.monologue.rb:4:in `change'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:595:in `exec_migration'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:578:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:577:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:752:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:953:in `block in migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `each'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:949:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:807:in `up'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/migration.rb:785:in `migrate'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `eval'
/home/admin/.rvm/gems/ruby-2.1.1@fr_ror/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
➜  tgl git:(issue-2-scaffold) ✗
msevestre commented 10 years ago

This is really weird. The Post model is defined in the app and nothing needs to be done aside from run the migrations

Copied migration 20140801070242_create_monologue_posts.monologue.rb from monologue

Can you show me you Gemfile and gemfile.lock?

Thanks

xxxazxxx commented 10 years ago

I have faced this problem before where any attribute which ends in foo_id in a migration looks for a Foo model in rails 4

There are several things which are confusing me.

  1. MonologueUser Model is created but it is referenced using user_id in MonologuePostsRevision. Is it using a namespace? or i guess it will reference the main User model. I could just find Monologue namespace in last few migrations

I'm quite sure it is looking for a Post model.

Gemfile

source 'https://rubygems.org'
ruby '2.1.1'

gem 'rails', '~> 4.1.0'

#
# PLATFORM SPECIFIC
#
# OSX
gem 'rb-fsevent', group: [:development, :test]        # monitor file changes without hammering the disk
gem 'terminal-notifier-guard', group: [:development]  # notify terminal when specs run
gem 'terminal-notifier', group: [:development]
# LINUX
# gem 'rb-inotify', :group => [:development, :test]   # monitor file changes without hammering the disk

# Monitoring
gem 'rack-timeout', '~> 0.1.0beta3'
gem 'newrelic_rpm'
gem 'airbrake'                # use with airbrake.io or errbit
# gem 'airbrake_user_attributes'  # use with self-hosted errbit; see config/initializers/airbrake.rb
# gem 'rack-google-analytics'

# Data
gem 'pg'
gem 'mysql2'
gem 'schema_plus'             # add better index and foreign key support
# gem 'jbuilder'

# Assets
gem 'sass-rails'
gem 'haml-rails'
gem 'simple_form'
gem 'uglifier'
gem 'headjs-rails'

# Javascript
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'nprogress-rails'

# CoffeeScript
# Not needed in production if precompiling assets
gem 'coffee-rails'
# Uncomment if node.js is not installed
gem 'therubyracer', platforms: :ruby

# Design
gem 'bootstrap-sass'
# gem 'bourbon'
# gem 'neat'
# gem 'country_select'

# Email
gem 'premailer-rails'

# Authentication
gem 'devise'
gem 'cancan'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# gem 'omniauth-persona'
# gem 'omniauth-google-oauth2'
# gem 'omniauth-linkedin'

# Admin
gem 'rails_admin'

# Workers
gem 'sidekiq'
gem 'devise-async'
gem 'sinatra', require: false

# Utils
gem 'addressable'
gem 'settingslogic'

group :development do
  # Docs
  gem 'sdoc', require: false    # bundle exec rake doc:rails

  # Errors
  # gem 'better_errors'
  # gem 'binding_of_caller'     # extra features for better_errors
  # gem 'meta_request'          # for rails_panel chrome extension

  # Deployment
  # gem 'capistrano'

  # Guard
  gem 'guard-rspec'
  # gem 'guard-livereload'
  # gem 'rack-livereload'
end

group :development, :test do
  # Use spring or zeus
  gem 'spring'                  # keep application running in the background
  gem 'spring-commands-rspec'
  # gem 'zeus'                  # required in gemfile for guard

  # Debugging
  # gem 'pry'                   # better than irb
  # gem 'byebug'                # ruby 2.0 debugger with built-in pry
  gem 'pry-rails'               # adds rails specific commands to pry
  gem 'pry-byebug'              # add debugging commands to pry
  gem 'pry-stack_explorer'      # navigate call stack
  # gem 'pry-rescue'            # start pry session on uncaught exception
  # gem 'pry-doc'               # browse docs from console
  # gem 'pry-git'               # add git support to console
  # gem 'pry-remote'            # connect remotely to pry console
  # gem 'coolline'              # sytax highlighting as you type
  # gem 'coderay'               # use with coolline
  gem 'awesome_print'           # pretty pring debugging output

  # Testing
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'ffaker'
  gem 'capybara-webkit'
  # gem 'poltergeist'           # alternative to capybara-webkit
  # gem 'capybara-firebug'
  # gem 'launchy'               # save_and_open_page support for rspec
  # gem 'zeus-parallel_tests'   # speed up lengthy tests

  # Logging
  gem 'quiet_assets'
end

group :test do
  gem 'minitest'                # include minitest to prevent require 'minitest/autorun' warnings

  # Helpers
  gem 'shoulda-matchers'
  gem 'database_cleaner'
  # gem 'timecop'               # Mock Time

  # Coverage
  gem 'simplecov', require: false
  # gem 'coveralls', :require => false

  gem 'rspec-sidekiq'
end

group :production do
  gem 'dalli'                   # memcached
  gem 'memcachier'              # heroku add-on for auto config of dalli
  gem 'unicorn'
  gem 'rails_12factor'          # https://devcenter.heroku.com/articles/rails4
end

gem "elasticsearch", git: "git://github.com/elasticsearch/elasticsearch-ruby.git"
gem "elasticsearch-model", git: "git://github.com/elasticsearch/elasticsearch-rails.git"
gem "elasticsearch-rails", git: "git://github.com/elasticsearch/elasticsearch-rails.git"

gem "rolify"

# File Uploads
gem 'carrierwave'
gem 'rmagick'
gem "cocoon"

# API
gem 'rabl'
gem 'oj'

# Recurring Events
gem "ice_cube"
gem "recurring_select"

# analytics
gem "impressionist"

# blog
gem 'monologue', github: 'jipiboily/monologue', :branch => '0-4-stable'

Gemfile.lock

GIT
  remote: git://github.com/elasticsearch/elasticsearch-rails.git
  revision: 104f91f24ba8d3dc7629b0eaf058329dc2cdc08c
  specs:
    elasticsearch-model (0.1.1)
      activesupport (> 3)
      elasticsearch (> 0.4)
      hashie
    elasticsearch-rails (0.1.1)

GIT
  remote: git://github.com/elasticsearch/elasticsearch-ruby.git
  revision: c6a3782d4ed2a3ef97e97e4f2abcaa79a0da4d38
  specs:
    elasticsearch (1.0.1)
      elasticsearch-api (= 1.0.1)
      elasticsearch-transport (= 1.0.1)
    elasticsearch-api (1.0.1)
      multi_json
    elasticsearch-transport (1.0.1)
      faraday
      multi_json

GIT
  remote: git://github.com/jipiboily/monologue.git
  revision: a9f7c2636d66e261c5f5d2cf2ed6d154f57c2cdd
  branch: 0-4-stable
  specs:
    monologue (0.4.1)
      bcrypt (~> 3.1.7)
      ckeditor (~> 4.0.11)
      coffee-rails (~> 4.0.0)
      jquery-rails
      rails (>= 4.0.4)
      sass-rails (~> 4.0.0)
      select2-rails (~> 3.2)
      truncate_html

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (4.1.0)
      actionpack (= 4.1.0)
      actionview (= 4.1.0)
      mail (~> 2.5.4)
    actionpack (4.1.0)
      actionview (= 4.1.0)
      activesupport (= 4.1.0)
      rack (~> 1.5.2)
      rack-test (~> 0.6.2)
    actionview (4.1.0)
      activesupport (= 4.1.0)
      builder (~> 3.1)
      erubis (~> 2.7.0)
    activemodel (4.1.0)
      activesupport (= 4.1.0)
      builder (~> 3.1)
    activerecord (4.1.0)
      activemodel (= 4.1.0)
      activesupport (= 4.1.0)
      arel (~> 5.0.0)
    activesupport (4.1.0)
      i18n (~> 0.6, >= 0.6.9)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.1)
      tzinfo (~> 1.1)
    addressable (2.3.6)
    airbrake (3.1.16)
      builder
      multi_json
    arel (5.0.0)
    awesome_print (1.2.0)
    bcrypt (3.1.7)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (3.1.1.0)
      sass (~> 3.2)
    builder (3.2.2)
    byebug (2.7.0)
      columnize (~> 0.3)
      debugger-linecache (~> 1.2)
    cancan (1.6.10)
    capybara (2.1.0)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    capybara-webkit (1.1.1)
      capybara (>= 2.0.2, < 2.2.0)
      json
    carrierwave (0.10.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
    celluloid (0.15.2)
      timers (~> 1.1.0)
    celluloid-io (0.15.0)
      celluloid (>= 0.15.0)
      nio4r (>= 0.5.0)
    ckeditor (4.0.11)
      mime-types
      orm_adapter (~> 0.5.0)
    cocoon (1.2.6)
    coderay (1.1.0)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.0)
    columnize (0.3.6)
    connection_pool (2.0.0)
    css_parser (1.3.5)
      addressable
    dalli (2.7.0)
    database_cleaner (1.2.0)
    debug_inspector (0.0.2)
    debugger-linecache (1.2.0)
    devise (3.2.4)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 3.2.6, < 5)
      thread_safe (~> 0.1)
      warden (~> 1.2.3)
    devise-async (0.9.0)
      devise (~> 3.2)
    diff-lcs (1.2.5)
    docile (1.1.3)
    erubis (2.7.0)
    execjs (2.0.2)
    factory_girl (4.4.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.4.1)
      factory_girl (~> 4.4.0)
      railties (>= 3.0.0)
    faraday (0.9.0)
      multipart-post (>= 1.2, < 3)
    ffaker (1.24.0)
    ffi (1.9.3)
    font-awesome-rails (4.0.3.1)
      railties (>= 3.2, < 5.0)
    formatador (0.2.4)
    guard (2.6.0)
      formatador (>= 0.2.4)
      listen (~> 2.7)
      lumberjack (~> 1.0)
      pry (>= 0.9.12)
      thor (>= 0.18.1)
    guard-rspec (4.2.8)
      guard (~> 2.1)
      rspec (>= 2.14, < 4.0)
    haml (4.0.5)
      tilt
    haml-rails (0.5.3)
      actionpack (>= 4.0.1)
      activesupport (>= 4.0.1)
      haml (>= 3.1, < 5.0)
      railties (>= 4.0.1)
    hashie (2.1.0)
    headjs-rails (0.4.2)
      rails (>= 3.0.0)
    hike (1.2.3)
    htmlentities (4.3.1)
    httpclient (2.4.0)
    i18n (0.6.9)
    ice_cube (0.12.1)
    impressionist (1.5.1)
      httpclient (~> 2.2)
      nokogiri (~> 1.5)
    jquery-rails (3.1.0)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-turbolinks (2.0.2)
      railties (>= 3.1.0)
      turbolinks
    jquery-ui-rails (4.2.0)
      railties (>= 3.2.16)
    json (1.8.1)
    jwt (0.1.11)
      multi_json (>= 1.5)
    kaminari (0.15.1)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    kgio (2.9.2)
    libv8 (3.16.14.3)
    listen (2.7.1)
      celluloid (>= 0.15.2)
      celluloid-io (>= 0.15.0)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    lumberjack (1.0.5)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    memcachier (0.0.2)
    method_source (0.8.2)
    mime-types (1.25.1)
    mini_portile (0.5.3)
    minitest (5.3.2)
    multi_json (1.9.2)
    multi_xml (0.5.5)
    multipart-post (2.0.0)
    mysql2 (0.3.16)
    nested_form (0.3.2)
    newrelic_rpm (3.7.3.204)
    nio4r (1.0.0)
    nokogiri (1.6.1)
      mini_portile (~> 0.5.0)
    nprogress-rails (0.1.2.3)
    oauth (0.4.7)
    oauth2 (0.9.3)
      faraday (>= 0.8, < 0.10)
      jwt (~> 0.1.8)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (~> 1.2)
    oj (2.9.4)
    omniauth (1.2.1)
      hashie (>= 1.2, < 3)
      rack (~> 1.0)
    omniauth-facebook (1.6.0)
      omniauth-oauth2 (~> 1.1)
    omniauth-oauth (1.0.1)
      oauth
      omniauth (~> 1.0)
    omniauth-oauth2 (1.1.2)
      faraday (>= 0.8, < 0.10)
      multi_json (~> 1.3)
      oauth2 (~> 0.9.3)
      omniauth (~> 1.2)
    omniauth-twitter (1.0.1)
      multi_json (~> 1.3)
      omniauth-oauth (~> 1.0)
    orm_adapter (0.5.0)
    pg (0.17.1)
    polyglot (0.3.4)
    premailer (1.8.2)
      css_parser (>= 1.3.5)
      htmlentities (>= 4.0.0)
    premailer-rails (1.7.0)
      actionmailer (>= 3, < 5)
      premailer (~> 1.7, >= 1.7.9)
    pry (0.9.12.6)
      coderay (~> 1.0)
      method_source (~> 0.8)
      slop (~> 3.4)
    pry-byebug (1.3.2)
      byebug (~> 2.7)
      pry (~> 0.9.12)
    pry-rails (0.3.2)
      pry (>= 0.9.10)
    pry-stack_explorer (0.4.9.1)
      binding_of_caller (>= 0.7)
      pry (>= 0.9.11)
    quiet_assets (1.0.2)
      railties (>= 3.1, < 5.0)
    rabl (0.10.1)
      activesupport (>= 2.3.14)
    rack (1.5.2)
    rack-pjax (0.7.0)
      nokogiri (~> 1.5)
      rack (~> 1.3)
    rack-protection (1.5.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rack-timeout (0.1.0beta3)
    rails (4.1.0)
      actionmailer (= 4.1.0)
      actionpack (= 4.1.0)
      actionview (= 4.1.0)
      activemodel (= 4.1.0)
      activerecord (= 4.1.0)
      activesupport (= 4.1.0)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.1.0)
      sprockets-rails (~> 2.0)
    rails_12factor (0.0.2)
      rails_serve_static_assets
      rails_stdout_logging
    rails_admin (0.6.2)
      builder (~> 3.1)
      coffee-rails (~> 4.0)
      font-awesome-rails (>= 3.0)
      haml (~> 4.0)
      jquery-rails (~> 3.0)
      jquery-ui-rails (~> 4.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (~> 0.7)
      rails (~> 4.0)
      remotipart (~> 1.0)
      safe_yaml (~> 1.0)
      sass-rails (~> 4.0)
    rails_serve_static_assets (0.0.2)
    rails_stdout_logging (0.0.3)
    railties (4.1.0)
      actionpack (= 4.1.0)
      activesupport (= 4.1.0)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    raindrops (0.13.0)
    rake (10.2.2)
    rb-fsevent (0.9.4)
    rb-inotify (0.9.3)
      ffi (>= 0.5.0)
    rdoc (4.1.1)
      json (~> 1.4)
    recurring_select (1.2.1)
      coffee-rails (>= 3.1)
      ice_cube (>= 0.11)
      jquery-rails (>= 3.0)
      rails (>= 3.2)
      sass-rails (>= 3.1)
    redis (3.0.7)
    redis-namespace (1.4.1)
      redis (~> 3.0.4)
    ref (1.0.5)
    remotipart (1.2.1)
    rmagick (2.13.2)
    rolify (3.4.0)
    rspec (2.14.1)
      rspec-core (~> 2.14.0)
      rspec-expectations (~> 2.14.0)
      rspec-mocks (~> 2.14.0)
    rspec-core (2.14.8)
    rspec-expectations (2.14.5)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.14.6)
    rspec-rails (2.14.2)
      actionpack (>= 3.0)
      activemodel (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 2.14.0)
      rspec-expectations (~> 2.14.0)
      rspec-mocks (~> 2.14.0)
    rspec-sidekiq (1.0.0)
      rspec (>= 2.0.0)
      sidekiq (>= 2.4.0)
    safe_yaml (1.0.2)
    sass (3.2.19)
    sass-rails (4.0.3)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.2.0)
      sprockets (~> 2.8, <= 2.11.0)
      sprockets-rails (~> 2.0)
    schema_plus (1.5.0)
      activerecord (>= 3.2)
      valuable
    sdoc (0.4.0)
      json (~> 1.8)
      rdoc (~> 4.0, < 5.0)
    select2-rails (3.5.9)
      thor (~> 0.14)
    settingslogic (2.0.9)
    shoulda-matchers (2.5.0)
      activesupport (>= 3.0.0)
    sidekiq (3.0.0)
      celluloid (>= 0.15.2)
      connection_pool (>= 2.0.0)
      json
      redis (>= 3.0.6)
      redis-namespace (>= 1.3.1)
    simple_form (3.0.2)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    simplecov (0.8.2)
      docile (~> 1.1.0)
      multi_json
      simplecov-html (~> 0.8.0)
    simplecov-html (0.8.0)
    sinatra (1.4.5)
      rack (~> 1.4)
      rack-protection (~> 1.4)
      tilt (~> 1.3, >= 1.3.4)
    slop (3.5.0)
    spring (1.1.2)
    spring-commands-rspec (1.0.1)
      spring (>= 0.9.1)
    sprockets (2.11.0)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sprockets-rails (2.1.1)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      sprockets (~> 2.8)
    terminal-notifier (1.6.0)
    terminal-notifier-guard (1.5.3)
    therubyracer (0.12.1)
      libv8 (~> 3.16.14.0)
      ref
    thor (0.19.1)
    thread_safe (0.3.3)
    tilt (1.4.1)
    timers (1.1.0)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    truncate_html (0.9.2)
    turbolinks (2.2.2)
      coffee-rails
    tzinfo (1.1.0)
      thread_safe (~> 0.1)
    uglifier (2.5.0)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    unicorn (4.8.2)
      kgio (~> 2.6)
      rack
      raindrops (~> 0.7)
    valuable (0.9.8)
    warden (1.2.3)
      rack (>= 1.0)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  addressable
  airbrake
  awesome_print
  bootstrap-sass
  cancan
  capybara-webkit
  carrierwave
  cocoon
  coffee-rails
  dalli
  database_cleaner
  devise
  devise-async
  elasticsearch!
  elasticsearch-model!
  elasticsearch-rails!
  factory_girl_rails
  ffaker
  guard-rspec
  haml-rails
  headjs-rails
  ice_cube
  impressionist
  jquery-rails
  jquery-turbolinks
  memcachier
  minitest
  monologue!
  mysql2
  newrelic_rpm
  nprogress-rails
  oj
  omniauth
  omniauth-facebook
  omniauth-twitter
  pg
  premailer-rails
  pry-byebug
  pry-rails
  pry-stack_explorer
  quiet_assets
  rabl
  rack-timeout (~> 0.1.0beta3)
  rails (~> 4.1.0)
  rails_12factor
  rails_admin
  rb-fsevent
  recurring_select
  rmagick
  rolify
  rspec-rails
  rspec-sidekiq
  sass-rails
  schema_plus
  sdoc
  settingslogic
  shoulda-matchers
  sidekiq
  simple_form
  simplecov
  sinatra
  spring
  spring-commands-rspec
  terminal-notifier
  terminal-notifier-guard
  therubyracer
  turbolinks
  uglifier
  unicorn
xxxazxxx commented 10 years ago

Problem solved. It's because the gem called schema_plus. https://github.com/lomba/schema_plus#foreign-key-constraints

ronangimenes commented 10 years ago

But how do you solved it? Did you remove the gem?

I'm having the same problem after I made a 'rake db:rollback'. Now when I try to run the 'rake db:migrate' to create a table it says the table is already created... even it's not.

error: ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR: relation "my_table_name" does not exist

despite I'm not using the schema_plus gem, I'm using the gem foreigner v. 1.6.1

Thank you.

xxxazxxx commented 10 years ago

@ronancn https://github.com/lomba/schema_plus#foreign-key-constraints