title: heroku run rake db:migrate, undefined method
body: <p>When I try to migrate my db over to heroku, I get this error. I think it may have something to do with Paperclip. When I rake my db locally on my computer, it works fine though. </p>
  
  <p><strong>Error message</strong></p>
  
  <pre><code>Running `rake db:migrate` attached to terminal... up, run.2870
     (705.4ms)  CREATE TABLE "schema_migrations" ("version" character varying NOT NULL) 
     (59.9ms)  CREATE UNIQUE INDEX  "unique_schema_migrations" ON "schema_migrations"  ("version")
    ActiveRecord::SchemaMigration Load (2.7ms)  SELECT "schema_migrations".* FROM "schema_migrations"
  Migrating to CreateCountries (20150113022256)
     (3.2ms)  BEGIN
  == 20150113022256 CreateCountries: migrating ==================================
  -- create_table(:countries)
     (4.1ms)  ROLLBACK
  rake aborted!
  StandardError: An error has occurred, this and all later migrations canceled:
  
  undefined method `attachment' for #&lt;ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition:0x007fb245cca098&gt;/app/db/migrate/20150113022256_create_countries.rb:6:in `block in change'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:200:in `create_table'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in `block in method_missing'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `block in say_with_time'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `say_with_time'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:652:in `method_missing'
  /app/db/migrate/20150113022256_create_countries.rb:3:in `change'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:606:in `exec_migration'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:589:in `block in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:588:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:765:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `ddl_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:956:in `block in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `each'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in &lt;top (required)&gt;'
  NoMethodError: undefined method `attachment' for #&lt;ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition:0x007fb245cca098&gt;
  /app/db/migrate/20150113022256_create_countries.rb:6:in `block in change'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/schema_statements.rb:200:in `create_table'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:662:in `block in method_missing'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `block in say_with_time'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:632:in `say_with_time'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:652:in `method_missing'
  /app/db/migrate/20150113022256_create_countries.rb:3:in `change'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:606:in `exec_migration'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:590:in `block (2 levels) in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:589:in `block in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:588:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:765:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:995:in `block in execute_migration_in_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `block in ddl_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:1041:in `ddl_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:956:in `block in migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `each'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
  /app/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; db:migrate
  </code></pre>
  
  <p><strong>20150113022256_create_countries.rb</strong></p>
  
  <pre><code>class CreateCountries &lt; ActiveRecord::Migration
    def change
      create_table :countries do |t|
        t.string :text
        t.string :title
        t.attachment :photo
  
        t.timestamps null: false
      end
    end
  end
  </code></pre>
  
  <hr>
  
  <p><strong>Gemfile</strong></p>
  
  <pre><code>source 'https://rubygems.org'
  
  
  # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
  gem 'rails', '4.2.0'
  # Use sqlite3 as the database for Active Record
  group :development, :test do 
      gem 'sqlite3'
  end
  
  gem 'pg'
  # Use SCSS for stylesheets
  gem 'sass-rails', '~&gt; 5.0'
  # Use Uglifier as compressor for JavaScript assets
  gem 'uglifier', '&gt;= 1.3.0'
  # Use CoffeeScript for .coffee assets and views
  gem 'coffee-rails', '~&gt; 4.1.0'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', platforms: :ruby
  
  # Use jquery as the JavaScript library
  gem 'jquery-rails'
  # Turbolinks makes following links in your web application faster. Read more:      https://github.com/rails/turbolinks
  gem 'jquery-turbolinks'
  gem 'turbolinks'
  # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
  gem 'jbuilder', '~&gt; 2.0'
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', '~&gt; 0.4.0', group: :doc
  
  gem 'rails_12factor', group: :production
  
  # Use ActiveModel has_secure_password
  # gem 'bcrypt', '~&gt; 3.1.7'
  
  # Use Unicorn as the app server
  # gem 'unicorn'
  
  # Use Capistrano for deployment
  # gem 'capistrano-rails', group: :development
  
  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug'
  
    # Access an IRB console on exception pages or by using &lt;%= console %&gt; in views
    gem 'web-console', '~&gt; 2.0'
  
    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
    gem 'spring'
  
    gem 'paperclip'
  
    ruby '2.2.0'
  
  end
  </code></pre>
  
  <hr>