Coderama
Coderama

Reputation: 11352

rake system command causes bundle error

I'm trying to run this rake task but it keeps on returning the following error:

Could not find libv8-3.3.10.4 in any of the sources
Run `bundle install` to install missing gems.

When I try and run bundle install bundler says everything is up to date.

I am running the task using this command: bundle exec rake deploy:staging

Here's what my rake task looks like:

  task :staging  do
    app = "heroku-app-name"

    puts "Turn maintenance on"
    system "heroku maintenance:on --app #{app}"
  end

Upvotes: 2

Views: 93

Answers (1)

Gary Foster
Gary Foster

Reputation: 171

I was able to shell out to heroku commands from a rake task by wrapping the command in a Bundler.with_clean_env block like as follows:

Bundler.with_clean_env do
  system "heroku maintenance:on --app #{app}"
end

Upvotes: 1

Related Questions