#1 By: luke154, January 31st, 2014 19:09
I'm running into a similar issue as this question:
I updated my Gemfile to use Ruby 2.0.0 Now when I do my git push heroku master command the output results show this: Could not detect rake tasks ensure you can run `$ bundle exec rake -P` against your app with no environment variables present and using the production group of your Gemfile. This may be intentional, if you expected rake tasks to be run cancel the build (CTRL+C) and fix the error then commit the fix: rake aborted! bad URI(is not URI?): Supposedly it is having trouble with ...
But the error is slightly different and I tried working through the articles suggested with no luck. Here is the error that I'm seeing when deploying to Heroku (error came out of the blue, have never had any trouble before).
Your bundle is complete!
Gems in the groups development and test were not installed.
It was installed into ./vendor/bundle
Bundle completed (6.83s)
Cleaning up the bundler cache.
Removing rake (10.1.0)
-----> Writing config/database.yml to read from DATABASE_URL
Could not detect rake tasks
ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
and using the production group of your Gemfile.
This may be intentional, if you expected rake tasks to be run
cancel the build (CTRL+C) and fix the error then commit the fix:
(erb):9:in `rescue in <main>'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0.rc1/lib/active_record/railtie.rb:43:in `block in <class:Railtie>'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc1/lib/rails/railtie.rb:201:in `block in run_tasks_blocks'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0.rc1/lib/rails/application.rb:242:in `block in run_tasks_blocks'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/Rakefile:6:in `<top (required)>'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/tmp/build_f276e361-6556-4445-97bd-6989b0c436f4/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
My app is still deploying but it isn't running rake assets : precompile so none of my assets are loading.
Any help would be greatly appreciated!
#2 By: guilleiguaran, February 1st, 2014 09:19
Can you verify if the error displayed during the deploy is true?
#3 By: luke154, February 1st, 2014 12:14
I'm not an experienced developer so I've tried my best - from what I can see it doesn't seem to be? When I run heroku config, I see:
Both match up - I assume that's how it should be?
#4 By: Richard Schneeman, February 3rd, 2014 11:08
When you deploy your environment variables are not present. What's happening is that when you run
bundle exec rake -T (which should not execute any code, only output your tasks) it is attempting to connect to the database. You are using a RC version of Rails 4 that accidentally attempts to load the database configuration when the Rakefile is sourced instead of when a database related task is run. Upgrade to 4.0.2 to avoid this error.
#5 By: luke154, February 3rd, 2014 12:51
Thank you so much schneems - that did it!