# Compile ruby with oniguruma on OS X

**URL:** <https://rubytalk.org/t/compile-ruby-with-oniguruma-on-os-x/33148>\
**Category:** ruby-talk\
**Created:** [22 November 2006 23:10 UTC](https://rubytalk.org/t/compile-ruby-with-oniguruma-on-os-x/33148 "2006-11-22T23:10:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashley\_Moran](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Ashley\_Moran](https://rubytalk.org/u/Ashley_Moran)\
**Post date:** [22 November 2006 23:10 UTC](https://rubytalk.org/t/compile-ruby-with-oniguruma-on-os-x/33148/1 "2006-11-22T23:10:24Z")

</div>

Hi

I've just got my hands on the latest Mastering Regular Expressions. I want to play with some of the clever stuff (eg lookbehinds) in ruby. I'm running OS X on my desktop, and my ruby is compiled from MacPorts. There's an oniguruma port, but does anyone know how to recompile ruby to use it? Is there a command line switch I can pass to the port command?

Thanks  
Ashley

---

<div class="post-metadata">

**Author:** ![Brabuhr](https://avatars.discourse-cdn.com/v4/letter/b/919ad9/32.png) [@Brabuhr](https://rubytalk.org/u/Brabuhr)\
**Post date:** [23 November 2006 00:51 UTC](https://rubytalk.org/t/compile-ruby-with-oniguruma-on-os-x/33148/2 "2006-11-23T00:51:20Z")

</div>

> I've just got my hands on the latest Mastering Regular Expressions.  
> I want to play with some of the clever stuff (eg lookbehinds) in  
> ruby. I'm running OS X on my desktop, and my ruby is compiled from  
> MacPorts. There's an oniguruma port, but does anyone know how to  
> recompile ruby to use it? Is there a command line switch I can pass  
> to the port command?

I've not used MacPorts, but, it is pretty straight forward to build it by  
hand:

~/Desktop $ tar xzf ruby-1.8.5.tar.gz  
~/Desktop $ tar xzf onigd2\_5\_8.tar.gz

~/Desktop $ cd oniguruma/  
~/Desktop/oniguruma $ ./configure --with-rubydir=~/Desktop/ruby-1.8.5  
~/Desktop/oniguruma $ make 185  
~/Desktop/oniguruma $ cd ..

~/Desktop $ cd ruby-1.8.5  
~/Desktop/ruby-1.8.5 $ ./configure --prefix=/opt/ruby/v1.8.5-oniguruma  
~/Desktop/ruby-1.8.5 $ make  
~/Desktop/ruby-1.8.5 $ sudo make install

~/Desktop/ruby-1.8.5 $ /opt/ruby/v1.8.5-oniguruma/bin/ruby -v  
ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]  
~/Desktop/ruby-1.8.5 $ /opt/ruby/v1.8.5-oniguruma/bin/ruby -e "put s  
Regexp::ENGINE"  
Oniguruma

---

<div class="post-metadata">

**Author:** ![Ashley\_Moran](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@Ashley\_Moran](https://rubytalk.org/u/Ashley_Moran)\
**Post date:** [24 November 2006 09:49 UTC](https://rubytalk.org/t/compile-ruby-with-oniguruma-on-os-x/33148/3 "2006-11-24T09:49:42Z")

</div>

Ok cheers I'll try that instead

> **···**
>
> On 23 Nov 2006, at 00:51, brabuhr@gmail.com wrote:
> 
> > I've not used MacPorts, but, it is pretty straight forward to build it by  
> > hand:
> > 
> > ~/Desktop $ tar xzf ruby-1.8.5.tar.gz  
> > ~/Desktop $ tar xzf onigd2\_5\_8.tar.gz
> > 
> > ~/Desktop $ cd oniguruma/  
> > ~/Desktop/oniguruma $ ./configure --with-rubydir=~/Desktop/ruby-1.8.5  
> > ~/Desktop/oniguruma $ make 185  
> > ~/Desktop/oniguruma $ cd ..
> > 
> > ~/Desktop $ cd ruby-1.8.5  
> > ~/Desktop/ruby-1.8.5 $ ./configure --prefix=/opt/ruby/v1.8.5-oniguruma  
> > ~/Desktop/ruby-1.8.5 $ make  
> > ~/Desktop/ruby-1.8.5 $ sudo make install
> > 
> > ~/Desktop/ruby-1.8.5 $ /opt/ruby/v1.8.5-oniguruma/bin/ruby -v  
> > ruby 1.8.5 (2006-08-25) [powerpc-darwin8.8.0]  
> > ~/Desktop/ruby-1.8.5 $ /opt/ruby/v1.8.5-oniguruma/bin/ruby -e "put s  
> > Regexp::ENGINE"  
> > Oniguruma
