1

I'm trying to migrate my postgresql database on Heroku. When I run "heroku run rake db:migrate fails" I recieve this error:

Running `rake db:migrate` attached to terminal... up, run.4898                                                       
/usr/bin/env: ruby1.9.1: No such file or directory

When I run "heroku run ruby -v":

Running `ruby -v` attached to terminal... up, run.9649                                                               
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

Here is my gemfile:

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

Thank you for taking the time to read this.

kruptos
  • 15
  • 5
  • 1
    Here have one issue to same question: [http://stackoverflow.com/questions/15443456/windows-heroku-run-rake-dbmigrate-error-usr-bin-env-ruby-exe-no-such-file-o](http://stackoverflow.com/questions/15443456/windows-heroku-run-rake-dbmigrate-error-usr-bin-env-ruby-exe-no-such-file-o) – overallduka Aug 11 '13 at 02:22
  • Looks like @overallduka has the answer in the linked question – BigRon Apr 18 '15 at 16:22

1 Answers1

0

u can use this code instead

heroku run:detached rake db:migrate

it will work. make sure to ADD, COMMIT, and PUSH before running the final code.

Goto to your directly where your project is

$ git add .
$ git commit -m "heroku repo"
$ git push heroku master

and after that run the final code

heroku run:detached rake db:migrate
Piyush Maurya
  • 1,945
  • 16
  • 26