# How do I get ruby-zlib-0.6.0 working on OS X

**URL:** <https://www.ruby-forum.com/t/how-do-i-get-ruby-zlib-0-6-0-working-on-os-x/71062>\
**Category:** Ruby\
**Created:** [October 5, 2006, 3:05am UTC](https://www.ruby-forum.com/t/how-do-i-get-ruby-zlib-0-6-0-working-on-os-x/71062 "2006-10-05T03:05:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![suntou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@suntou](https://www.ruby-forum.com/u/suntou)\
**Post date:** [October 5, 2006, 3:05am UTC](https://www.ruby-forum.com/t/how-do-i-get-ruby-zlib-0-6-0-working-on-os-x/71062/1 "2006-10-05T03:05:36Z")

</div>

I need to use the zlib module, but when I put this code in:

require ‘zlib’

class SController \< ApplicationController  
def zip  
s = “Hello”  
defl = Deflate.new  
deflated = defl.deflate(s)  
render :inline =\> %{ #{deflated} }  
end  
end

I got following message:

NameError in SController#zip

uninitialized constant Deflate

RAILS\_ROOT: /Users/jianshen/jedmin/suntou/public/…/config/…  
Application Trace | Framework Trace | Full Trace

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:133:in  
`const_missing' #{RAILS_ROOT}/app/controllers/s_controller.rb:15:in`zip’

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:133:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in`perform\_action\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in`perform\_action\_without\_rescue’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/rescue.rb:82:in  
`perform_action' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in`process\_without\_filters’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/filters.rb:377:in  
`process_without_session_management_support' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in`process’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in`process\_request’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:54:in  
`process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:in`each\_cgi’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:597:in `each_cgi' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in`process!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:23:in  
`process!’  
/Users/jianshen/jedmin/suntou/public/dispatch.fcgi:24

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:123:in  
`const_missing' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:131:in`const\_missing’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:133:in  
`const_missing' #{RAILS_ROOT}/app/controllers/s_controller.rb:15:in`zip’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/base.rb:910:in  
`perform_action_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:in`perform\_action\_without\_benchmark’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:in`measure’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/benchmarking.rb:69:in  
`perform_action_without_rescue' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in`perform\_action’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/base.rb:381:in  
`process_without_filters' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in`process\_without\_session\_management\_support’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action\_controller/session\_management.rb:117:in  
`process' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:150:in  
`process_request' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in`process!’  
/usr/local/lib/ruby/site\_ruby/1.8/fcgi.rb:600:in `each_cgi' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in`each\_cgi’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi\_handler.rb:53:in  
`process!' /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in`process!’  
/Users/jianshen/jedmin/suntou/public/dispatch.fcgi:24

This error occured while loading the following files:  
deflate.rb

I guess this is because zlib is not correctly installed. Here is my  
questions:

1. Should zlib be part of the standard ruby install that comes with  
ruby on rail?
2. Is ruby-zlib-0.6.0 the latest stable version?
3. How can I add zlib to my ror installation on OS X? I am currently  
running rails 1.1.2.

I am still new to rails and ruby. Your help is greatly appreciated.

Suntou

---

<div class="post-metadata">

**Author:** ![suntou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@suntou](https://www.ruby-forum.com/u/suntou)\
**Post date:** [October 5, 2006, 3:13am UTC](https://www.ruby-forum.com/t/how-do-i-get-ruby-zlib-0-6-0-working-on-os-x/71062/2 "2006-10-05T03:13:37Z")

</div>

Hi,

At Thu, 5 Oct 2006 10:05:05 +0900,  
suntou wrote in [ruby-talk:218070]:

> I need to use the zlib module, but when I put this code in:
> 
> require ‘zlib’
> 
> class SController \< ApplicationController  
> include Zlib
