Ruby on rails heroku运行rake db:迁移失败
我正在尝试将我的postgresql数据库迁移到Heroku上。当我运行heroku run rake db:migrate失败时,我收到以下错误:Ruby on rails heroku运行rake db:迁移失败,ruby-on-rails,heroku,pg,Ruby On Rails,Heroku,Pg,我正在尝试将我的postgresql数据库迁移到Heroku上。当我运行heroku run rake db:migrate失败时,我收到以下错误: Running `rake db:migrate` attached to terminal... up, run.4898 /usr/bin/env: ruby1.9.1: No such file or directory 当我运行h
Running `rake db:migrate` attached to terminal... up, run.4898
/usr/bin/env: ruby1.9.1: No such file or directory
当我运行heroku运行ruby-v时:
Running `ruby -v` attached to terminal... up, run.9649
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
这是我的档案:
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Heroku
gem 'rails_12factor', group: :production
# Devise Authenticaiton
gem 'devise'
# Omniauth Support
gem "omniauth"
gem 'omniauth-facebook'
gem 'omniauth-twitter'
# Faker gem to generate fake data
gem 'faker'
# Whenver gem to manage cron jobs
gem 'whenever', :require => false
# Bootstrap paginate support
gem 'bootstrap-will_paginate', :git => 'git://github.com/yrgoldteeth/bootstrap- will_paginate.git'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: :development
# Postgresql for Heroku
gem 'pg', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# 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'
gem 'jquery-ui-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', '~> 1.2'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
gem 'debugger', group: [:development, :test]
group :development do
gem 'better_errors'
gem 'binding_of_caller'
end
感谢您抽出时间阅读此代码。您可以改用此代码
heroku run:detached rake db:migrate
它会起作用的。
确保在运行最终代码之前添加、提交和推送
直接转到项目所在的位置
$ git add .
$ git commit -m "heroku repo"
$ git push heroku master
然后运行最后的代码
heroku run:detached rake db:migrate
同一个问题有一个问题:看起来@overallduka在链接的问题中找到了答案