我有以下任务:
task :migrate_test => :environment do
puts 'Running database migrations ...'
puts `heroku run rake db:migrate --app my-app`
end
当我heroku run rake db:migrate --app my-app
在控制台中运行时,迁移成功进行。但是,当我运行时rake migrate_test
,我收到以下错误:
Running database migrations ...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/dependency.rb:52:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError)
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:371:in `new'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:371:in `search'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:361:in `gems_size'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:159:in `start'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:159:in `map'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:159:in `start'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:128:in `resolve'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:127:in `catch'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/resolver.rb:127:in `resolve'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/definition.rb:182:in `resolve'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/definition.rb:113:in `specs'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/definition.rb:162:in `specs_for'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/definition.rb:151:in `requested_specs'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/environment.rb:23:in `requested_specs'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/runtime.rb:11:in `setup'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler.rb:116:in `setup'
from /Users/Will/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.2.0/lib/bundler/setup.rb:17
我相信这与在另一个找不到路径但无法找到解决方法的进程中运行任务有关。