Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NameError: uninitialized constant ActiveRecord::Migrator::Zlib

I'm new to Ruby and Active Record. I'm trying to run my first migration with the command:

rake db:migrate

I keep getting this error:

NameError: uninitialized constant ActiveRecord::Migrator::Zlib.

I've tried with different projects and all migrations are getting this error.

like image 568
h12r Avatar asked Jul 22 '16 17:07

h12r


2 Answers

I don't know whats up with this, took my entire day to find a solution

at the top of your environment.rb

require 'zlib'

this worked for me :)

like image 138
dirkdig Avatar answered Nov 15 '22 20:11

dirkdig


Add the following to Rakefile:

require 'zlib'

like image 1
Rocket Appliances Avatar answered Nov 15 '22 20:11

Rocket Appliances