Edit your Rakefile
in the root of your Rails app, and add the following:
ENV['NEW_RELIC_AGENT_ENABLED'] = 'false'
NewRelic agent will respect this environment variable, and setting it within the Rakefile
will cause it to be set for all rake tasks, before your app or newrelic agent loads.