# Problems installing mongrel in Ruby 1.9.1 on Mac OS

**URL:** <https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806>\
**Category:** Rails\
**Created:** [July 9, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806 "2009-07-09T14:56:43Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 9, 2009, 2:56pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/1 "2009-07-09T14:56:43Z")

</div>

Hello guys,

When I run Â³gem install mongrelÂ², I get the following error:

Building native extensions. This could take a while…  
ERROR: Error installing mongrel:  
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb  
checking for main() in -lc… yes  
creating Makefile

make  
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.7.0  
-I/usr/local/include/ruby-1.9.1/ruby/backward  
-I/usr/local/include/ruby-1.9.1 -I. -D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE  
-fno-common -D\_XOPEN\_SOURCE=1 -O2 -g -Wall -Wno-parentheses -fno-common  
-pipe -fno-common -o http11.o -c http11.c  
http11.c: In function Å’http\_fieldÂ¹:  
http11.c:77: error: Å’struct RStringÂ¹ has no member named Å’ptrÂ¹  
http11.c:77: error: Å’struct RStringÂ¹ has no member named Å’lenÂ¹  
http11.c:77: warning: left-hand operand of comma expression has no  
effect  
http11.c:77: warning: statement with no effect  
http11.c: In function Å’header\_doneÂ¹:  
http11.c:172: error: Å’struct RStringÂ¹ has no member named Å’ptrÂ¹  
http11.c:174: error: Å’struct RStringÂ¹ has no member named Å’ptrÂ¹  
http11.c:176: error: Å’struct RStringÂ¹ has no member named Å’ptrÂ¹  
http11.c:177: error: Å’struct RStringÂ¹ has no member named Å’lenÂ¹  
http11.c: In function Å’HttpParser\_executeÂ¹:  
http11.c:298: error: Å’struct RStringÂ¹ has no member named Å’ptrÂ¹  
http11.c:299: error: Å’struct RStringÂ¹ has no member named Å’lenÂ¹  
make: \*\*\* [http11.o] Error 1

Any ideas why?

The rest of the gems install ok.

I am using Ruby 1.9.1 on Mac OS 10.5.7.

Thanks,

GA

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 9, 2009, 9:39pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/2 "2009-07-09T21:39:44Z")

</div>

There may be something of use to you on this page:

[http://isitruby19.com/mongrel](http://isitruby19.com/mongrel)

HTH,

-Roy

* * *

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Guillermo A.  
Sent: Thursday, July 09, 2009 5:55 AM  
To: Ruby on Rails L.  
Subject: [Rails] Problems installing mongrel in Ruby 1.9.1 on Mac OS

Hello guys,

When I run “gem install mongrel”, I get the following error:

Building native extensions. This could take a while…  
ERROR: Error installing mongrel:  
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb  
checking for main() in -lc… yes  
creating Makefile

make  
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.7.0  
-I/usr/local/include/ruby-1.9.1/ruby/backward  
-I/usr/local/include/ruby-1.9.1 -I. -D\_XOPEN\_SOURCE -D\_DARWIN\_C\_SOURCE  
-fno-common -D\_XOPEN\_SOURCE=1 -O2 -g -Wall -Wno-parentheses -fno-common  
-pipe -fno-common -o http11.o -c http11.c  
http11.c: In function ‘http\_field’:  
http11.c:77: error: ‘struct RString’ has no member named ‘ptr’  
http11.c:77: error: ‘struct RString’ has no member named ‘len’  
http11.c:77: warning: left-hand operand of comma expression has no  
effect  
http11.c:77: warning: statement with no effect  
http11.c: In function ‘header\_done’:  
http11.c:172: error: ‘struct RString’ has no member named ‘ptr’  
http11.c:174: error: ‘struct RString’ has no member named ‘ptr’  
http11.c:176: error: ‘struct RString’ has no member named ‘ptr’  
http11.c:177: error: ‘struct RString’ has no member named ‘len’  
http11.c: In function ‘HttpParser\_execute’:  
http11.c:298: error: ‘struct RString’ has no member named ‘ptr’  
http11.c:299: error: ‘struct RString’ has no member named ‘len’  
make: \*\*\* [http11.o] Error 1

Any ideas why?

The rest of the gems install ok.

I am using Ruby 1.9.1 on Mac OS 10.5.7.

Thanks,

GA

* * *

GHC Confidentiality Statement

This message and any attached files might contain confidential  
information protected by federal and state law. The information is  
intended only for the use of the individual(s) or entities originally  
named as addressees. The improper disclosure of such information may be  
subject to civil or criminal penalties. If this message reached you in  
error, please contact the sender and destroy this message. Disclosing,  
copying, forwarding, or distributing the information by unauthorized  
individuals or entities is strictly prohibited by law.

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 10, 2009, 12:23am UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/3 "2009-07-10T00:23:55Z")

</div>

On Thu, Jul 9, 2009 at 5:55 AM, Guillermo A.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> creating Makefile  
> http11.c:77: warning: left-hand operand of comma expression has no effect
> 
> Any ideas why?
> 
> The rest of the gems install ok.
> 
> I am using Ruby 1.9.1 on Mac OS 10.5.7.
> 
> Thanks,
> 
> GA

Hi, you might want to try installing Thin and use it in place of  
Mongrel:

sudo gem install thin

Good luck,

-Conrad

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 23, 2009, 4:04pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/4 "2009-07-23T16:04:56Z")

</div>

Hi  
check the instructions on my blog  
[rubynyc.wordpress.com](http://rubynyc.wordpress.com) it has many other gems fixes for 1.9.1

you can install thin server, but you won’t be able to see the log like  
in mongrel  
you will lose the debugger, since its not compatible with 1.9 yet

Ami Mahloof

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 23, 2009, 5:39pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/5 "2009-07-23T17:39:27Z")

</div>

As a note, this works on all OS versions (windows/linux/mac).

Just browse to those listings (the notes above are for linux but you can  
translate them easy enough. Just find the files and change the lines as  
noted above, and it will work for you.

I’ve accomplished this on Windows Vista, Linux CentOS 5, Linux Ubuntu  
Hardy, and my friend has it working on the latest MAC OS.

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [July 23, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/6 "2009-07-23T17:35:12Z")

</div>

To fix this:

1. cd /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/ext/http11
2. sudo vi / mate on http11.c and:  
replace line 77 with  
for(ch = RSTRING\_PTR(f), end = ch + RSTRING\_LEN(f); ch \< end; ch++) {  
replace line 172 with  
colon = strchr(RSTRING\_PTR(temp), ‘:’);  
replace line 174 with  
rb\_hash\_aset(req, global\_server\_name, rb\_str\_substr(temp, 0, colon -  
RSTRING\_PTR(temp)));  
replce line 176,177  
rb\_str\_substr(temp, colon - RSTRING\_PTR(temp)+1,  
RSTRING\_LEN(temp)));  
replace lines 298 299  
dptr = RSTRING\_PTR(data);  
dlen = RSTRING\_LEN(data);
3. save the file, close the vi / textmate
4. sudo ruby extconf.rb && sudo make && sudo make install
5. cd …/…/lib/mongrel  
(or the full path  
“/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel”
6. mate / sudo vi handlers.rb
7. fix the case statements in  
On lines 208-212, change instances of “: false” to “then false”

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [September 30, 2009, 6:40pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/7 "2009-09-30T18:40:11Z")

</div>

I tried this and it seems to have worked for me. Thank god to whoever  
posted this!

Cris

Alpha B. wrote:

> To fix this:
> 
> 1. cd /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/ext/http11
> 2. sudo vi / mate on http11.c and:  
> replace line 77 with  
> for(ch = RSTRING\_PTR(f), end = ch + RSTRING\_LEN(f); ch \< end; ch++) {  
> replace line 172 with  
> colon = strchr(RSTRING\_PTR(temp), ‘:’);  
> replace line 174 with  
> rb\_hash\_aset(req, global\_server\_name, rb\_str\_substr(temp, 0, colon -  
> RSTRING\_PTR(temp)));  
> replce line 176,177  
> rb\_str\_substr(temp, colon - RSTRING\_PTR(temp)+1,  
> RSTRING\_LEN(temp)));  
> replace lines 298 299  
> dptr = RSTRING\_PTR(data);  
> dlen = RSTRING\_LEN(data);
> 3. save the file, close the vi / textmate
> 4. sudo ruby extconf.rb && sudo make && sudo make install
> 5. cd …/…/lib/mongrel  
> (or the full path  
> “/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel”
> 6. mate / sudo vi handlers.rb
> 7. fix the case statements in  
> On lines 208-212, change instances of “: false” to “then false”

---

<div class="post-metadata">

**Author:** ![eipipuz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@eipipuz](https://www.ruby-forum.com/u/eipipuz)\
**Post date:** [April 26, 2010, 4:58pm UTC](https://www.ruby-forum.com/t/problems-installing-mongrel-in-ruby-1-9-1-on-mac-os/171806/8 "2010-04-26T16:58:55Z")

</div>

Alpha B. wrote:

> As a note, this works on all OS versions (windows/linux/mac).
> 
> Just browse to those listings (the notes above are for linux but you can  
> translate them easy enough. Just find the files and change the lines as  
> noted above, and it will work for you.
> 
> I’ve accomplished this on Windows Vista, Linux CentOS 5, Linux Ubuntu  
> Hardy, and my friend has it working on the latest MAC OS.

Thanks for the hard part! I have assembled your fix into a unified  
patch that can be easily applied to mongrel-1.1.5:

[http://github.com/gamache/mongrel-115-to-ruby-19](http://github.com/gamache/mongrel-115-to-ruby-19)

Hope this helps.

-pete gamache  
tack weld my last name to google’s free email domain
