使用jemalloc和rbenv编译Ruby 2.2的正确方法?

使用jemalloc和rbenv编译Ruby 2.2的正确方法?,ruby,compilation,rbenv,Ruby,Compilation,Rbenv,使用推荐的步骤(从根目录)下载并安装jemalloc 4.0.0: 已验证安装在我的路径中: $ls /usr/local/bin | grep je jemalloc-config jemalloc.sh jeprof 使用rbenv 0.4.0,尝试构建ruby 2.2.3,并按照指定将标志传递给ruby build,以使用--with jemalloc选项。构建失败:(如果我只是通过了编译器,它就成功了。你知道如何让rbenv/ruby构建找到我的jema

使用推荐的步骤(从根目录)下载并安装jemalloc 4.0.0:

已验证安装在我的路径中:

    $ls /usr/local/bin | grep je
    jemalloc-config
    jemalloc.sh
    jeprof
使用rbenv 0.4.0,尝试构建ruby 2.2.3,并按照指定将标志传递给ruby build,以使用
--with jemalloc
选项。构建失败:(如果我只是通过了编译器,它就成功了。你知道如何让rbenv/ruby构建找到我的jemalloc安装吗

$CC="/usr/local/Cellar/gcc5/5.2.0/bin/gcc-5" CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3
Downloading ruby-2.2.3.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/df795f2f99860745a416092a4004b016ccf77e8b82dec956b120f18bdc71edce
Installing ruby-2.2.3...

BUILD FAILED (OS X 10.10.4 using ruby-build 20150818)

Inspect or clean up the working tree at /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819
Results logged to /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819.log

Last 10 log lines:
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
checking for malloc_conf in -ljemalloc... no
checking jemalloc/jemalloc.h usability... no
checking jemalloc/jemalloc.h presence... no
checking for jemalloc/jemalloc.h... no
checking for jemalloc with JEMALLOC_MANGLE... no
configure: error: jemalloc requested but not found
make: *** No targets specified and no makefile found.  Stop.

找到了答案。清理了我的第一次尝试,然后在OS X Yosemite上,下载了
jemalloc-4.0.0.tar.bz2
。解包后,根据Nobu在中的注释从根目录运行
/configure--jemalloc prefix=“
。然后只需
制作
制作安装

一旦我确认jemalloc安装正确,我就能够通过
CONFIGURE_OPTS=“--with jemalloc”rbenv install 2.2.3
将选项传递给rbenv

好处:另一个有助于定位断点的方法是直接下载并解包ruby源代码tarball,然后在根目录中运行
/configure--with jemalloc
。它将输出所有构建检查,包括一个jemalloc检查

$CC="/usr/local/Cellar/gcc5/5.2.0/bin/gcc-5" CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3
Downloading ruby-2.2.3.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/df795f2f99860745a416092a4004b016ccf77e8b82dec956b120f18bdc71edce
Installing ruby-2.2.3...

BUILD FAILED (OS X 10.10.4 using ruby-build 20150818)

Inspect or clean up the working tree at /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819
Results logged to /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819.log

Last 10 log lines:
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
checking for malloc_conf in -ljemalloc... no
checking jemalloc/jemalloc.h usability... no
checking jemalloc/jemalloc.h presence... no
checking for jemalloc/jemalloc.h... no
checking for jemalloc with JEMALLOC_MANGLE... no
configure: error: jemalloc requested but not found
make: *** No targets specified and no makefile found.  Stop.