I am trying to run a migration script on irb but it returns syntax error.
irb(main):008:0> rake db:migrate:up VERSION=20171006190045
SyntaxError: (irb):8: syntax error, unexpected tLABEL
rake db:migrate:up VERSION=20171006190045
tried rake db:migrate:redo VERSION=20171006190045
Also tried this
irb(main):012:0> require 'db/migrate/20171006190045_update_details.rb'
LoadError: cannot load such file -- db/migrate/20171006190045_update_details.rb
from (irb):12
rake
is not meant to be run within IRB. I agree with @spickermann. You can run it in rails console by using system
command.
$ rails c
> system("rake db:migrate:up VERSION=20171006190045")
or simply in terminal
$ rake db:migrate:up VERSION=20171006190045