'heroku run rake db:migrate' gives error 'Cannot find module 'create-error-class'

rails

#1

I haven’t seen this error before, but the last couple of days I have been seeing this message. I get this problem in other rails projects where I have had no issues, and with databases that I have no problem with in the past, so I suspect that this is a cloud9 issue. This also occurred right about the same time as the disappearing rsa_key problem, although this might be coincidental.

I can ‘git push heroku master’ with no problem, but when it comes time to ‘heroku run rake db:migrate’ I get this:

heroku run rake db:migrate
! Error in heroku-run:
! Cannot find module ‘create-error-class’
! See /home/ubuntu/.heroku/error.log for more info.

The error log shows this:
‘less /home/ubuntu/.heroku/error.log’

2016/04/07 21:54:34 Error during run:null
2016/04/07 21:54:34 Error: Cannot find module 'create-error-class’
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)

at Object.
(/home/ubuntu/.heroku/node_modules/heroku-run/node_modules/heroku-cli-util/node_modules/got/index.js:17:26)
at Module._compile (module.js:413:34)
at Object.Module._extensions…js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)


#2

would you mind showing your rails gemfile?


#3
source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'

# Devise for user sessions, log in, log out, authentication
gem 'devise'
# Styling for applicaiton
gem 'twitter-bootstrap-rails'
# Styling for views
gem 'devise-bootstrap-views'
# Stripe for processing credit card payments
gem 'stripe'

# Bcrypt for passwords
#gem 'bcrypt', '~> 3.1.7'
# Enable pagination
#gem 'will_paginate', '~> 3.0.7'
#gem 'bootstrap-will_paginate', '0.0.10'
# Use SCSS for stylesheets
#gem 'bootstrap-sass', '~> 3.3.6'
#gem 'sass-rails', '~> 5.0'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/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

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
end

group :production do
  # Use postgres as the database for Active Record
  gem 'pg'
  
  #Use Level 12 Factorization for Rails
  gem 'rails_12factor'
end

group :development do
  # Use sqlite3 as the database for Active Record
  gem 'sqlite3'
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

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

#4

I think re-install the Heroku is a nice try.
Keep in mind that do backup before you do re-installation.

rm -rf ~/.heroku
heroku --version

Good luck.


#5

I tried this …

wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

It did not really help…


#6

Maybe I ran this in the wrong directory… let me check.


#7

Okay, this just started working again and I have NO IDEA WHY IT STOPPED or WHY IT STARTED to work…

At least it is working,


#8

I’ve just tried to run it as root :-
sudo heroku run rake db:migrate

It worked for me :smiley: