【问题标题】:heroku run rake db:migrate dosn't workheroku run rake db:migrate 不起作用
【发布时间】:2015-02-20 02:09:59
【问题描述】:

我正在尝试在 Heroku 上迁移我的 postgresql 数据库。当我跑步时

heroku run rake db:migrate
我得到了错误:
Could not find rake-0.9.6 in any of the sources   

运行 bundle exec 时出现同样的错误...,

 $rake --version
耙子,版本 10.4.2
 

我的宝石文件:

    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  

谢谢

【问题讨论】:

    标签: ruby-on-rails ruby heroku rake


    【解决方案1】:

    运行此命令

    heroku run bundle exec rake db:migrate
    

    这会起作用。

    如果不工作,可能你需要卸载 rake 所以跑吧

    gem uninstall rake
    

    然后运行

    bundle install
    

    然后

    bundle exec rake db:migrate
    

    【讨论】:

      【解决方案2】:

      除非您特别需要该版本,否则我会将 rake 排除在 Gemfile 之外。 Bundler 将使用正确的版本。

      【讨论】:

        猜你喜欢
        • 2014-07-10
        • 2014-03-21
        • 2015-05-29
        • 2017-01-07
        • 1970-01-01
        • 2018-01-12
        • 2012-04-08
        • 1970-01-01
        相关资源
        最近更新 更多