opscode/opscode-omnibus — pull request #541 by smith (2014-10-20 15:32:05+00:00)
Title: rake db:migrate can be confused by VERSION environment variable

If a VERSION environment variable is exists when `rake db:migrate` is run, such as when running `private-chef-ctl upgrade`, the db:migrate will try to use the value of VERSION which won't work and causes `rake db:migrate` to fail.

http://guides.rubyonrails.org/migrations.html#running-migrations

A workaround is to run the command with `VERSION=` prepended.

A fix would be to set the environment variable in the execute block.

I tested changing this:

```
environment({"RAILS_ENV" => "production"})
```

to this:

```
environment({"RAILS_ENV" => "production", "VERSION" => ""})
```

in this line

https://github.com/opscode/opscode-omnibus/blob/11.2.2/files/private-chef-cookbooks/private-chef/recipes/oc_id.rb#L112

and it allowed the upgrade to proceed successfully.