Having trouble with installation during the db:migrate step


(Sri Sonti) #1

I followed the guide on github until I got to the following steps:

# Run these commands as the discourse user
# The database name here should match the production one in database.yml
cd /var/www/discourse
createdb discourse_prod
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake db:migrate
RUBY_GC_MALLOC_LIMIT=90000000 RAILS_ENV=production bundle exec rake assets:precompile

db:migrate threw me an error:

==  RenameBestOfToSummary: migrating ==========================================
-- rename_column(:topics, :has_best_of, :has_summary)
rake aborted!
An error has occurred, this and all later migrations canceled:

PG::UndefinedColumn: ERROR:  column "has_best_of" does not exist
: ALTER TABLE "topics" RENAME COLUMN "has_best_of" TO "has_summary"/var/www/discourse/vendor/bundle/ruby/2.0.0/bundler/gems/rack-mini-profiler-5f2048351f5f/lib/patches/sql_patches.rb:155:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.0.0/bundler/gems/rack-mini-profiler-5f2048351f5f/lib/patches/sql_patches.rb:155:in `async_exec'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:435:in `block in log'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract_adapter.rb:430:in `log'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql/database_statements.rb:127:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/postgresql/schema_statements.rb:412:in `rename_column'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:625:in `block in method_missing'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:597:in `block in say_with_time'
/home/discourse/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:597:in `say_with_time'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:617:in `method_missing'
/var/www/discourse/db/migrate/20131118173159_rename_best_of_to_summary.rb:3:in `change'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:571:in `exec_migration'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:555:in `block (2 levels) in migrate'
/home/discourse/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:554:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:553:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:709:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:959:in `block in execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:1005:in `block in ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `block in transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:210:in `within_new_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/connection_adapters/abstract/database_statements.rb:202:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/transactions.rb:209:in `transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:1005:in `ddl_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:958:in `execute_migration_in_transaction'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:920:in `block in migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:916:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:916:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:764:in `up'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/migration.rb:742:in `migrate'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.1/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `call'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:236:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:231:in `execute'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:175:in `block in invoke_with_call_chain'
/home/discourse/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:168:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/task.rb:161:in `invoke'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:149:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `each'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:106:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:78:in `block in run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate

I’m a dev newbie, so I’m not entirely sure what to make of this. I’m installing Discourse on an EC2 instance (specifically Ubuntu 12.04).

Any help would be much appreciated!


(Sam Saffron) #2

I just fixed this regression happened due to some refactoring @eviltrout did.

If you are starting a new install drop the db and try the migrations from scratch.


(Jeff Atwood) #3