Closed xxxazxxx closed 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
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.
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
Problem solved. It's because the gem called schema_plus. https://github.com/lomba/schema_plus#foreign-key-constraints
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.
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
MySQL