Delta7
Delta7

Reputation: 41

(MIGRATE on RUBY) rake aborted! VERSION is required

I tried to migrate some command to database from ubuntu terminal.

Here's my terminal code:

rake db:migrate:up VERSION = 20140523041349

And this my migrate file code:

class Problem9 < ActiveRecord::Migration
def up
add_column :articles, :rating, :integer
change_column :users, :address, :text
rename_column :articles, :body, :description
end
def down
end
end

It appear the error like this:

rake aborted!
VERSION is required
/home/delta7/.rvm/gems/[email protected]/gems/activerecord-3.2.14/lib/active_record/railties/databases.rake:229:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:migrate:up
(See full trace by running task with --trace)

Any help will appreciated.

Upvotes: 1

Views: 1527

Answers (2)

pdobb
pdobb

Reputation: 18037

Remove the space in your argument, like so:

rake db:migrate:up VERSION=20140523041349

Rake is pretty picky. You may also need to prefix with bundle exec if working on multiple projects with multiple versions of rake:

bundle exec rake db:migrate:up VERSION=20140523041349

Upvotes: 2

falsetru
falsetru

Reputation: 369134

Specify version as an argument (no space around =):

rake db:migrate:up VERSION=20140523041349

Upvotes: 0

Related Questions