Nouayti Mohammed
Nouayti Mohammed

Reputation: 1

heroku run rake db:migrate dosn't work

I'm trying to migrate my postgresql database on Heroku. When I run

heroku run rake db:migrate
I got the error:

Could not find rake-0.9.6 in any of the sources   

the same error when I run bundle exec...,

 $rake --version
rake, version 10.4.2
 

my Gemfile:

    source 'https://rubygems.org'


group :production do
  gem 'pg', '0.15.1'
  gem 'rails_12factor'
end
group :development, :test do 
  gem 'sqlite3'
end

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
gem 'rake', '0.9.6'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring',        group: :development  

thank you

Upvotes: 0

Views: 467

Answers (2)

Apoorv
Apoorv

Reputation: 1379

Run this command

heroku run bundle exec rake db:migrate

This will work.

if not work, probably you need to uninstall rake so run

gem uninstall rake

then run

bundle install

then

bundle exec rake db:migrate

Upvotes: 1

stephenmurdoch
stephenmurdoch

Reputation: 34603

I would leave rake out of the Gemfile unless you specifically need that version. Bundler will use the correct version.

Upvotes: 0

Related Questions