错误 bundle install postgresql: `mktmpdir': parent directory is world writable but not sticky

error bundle install postgresql: `mktmpdir': parent directory is world writable but not sticky

我试图用数据库 postgresql 安装 rails,但出现错误:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
        --with-pg
        --without-pg
        --enable-windows-cross
        --disable-windows-cross
        --with-pg-config
        --without-pg-config
        --with-pg_config
        --without-pg_config
        --with-pg-dir
        --without-pg-dir
        --with-pg-include
        --without-pg-include=${pg-dir}/include
        --with-pg-lib
        --without-pg-lib=${pg-dir}/
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tmpdir.rb:92:in `mktmpdir': parent directory is world writable but not sticky (ArgumentError)
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:510:in `try_link0'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:534:in `try_link'
        from extconf.rb:36:in `<main>'


Gem files will remain installed in /tmp/bundler20150325-70824-ipx8vh/pg-0.18.1/gems/pg-0.18.1 for inspection.
Results logged to /tmp/bundler20150325-70824-ipx8vh/pg-0.18.1/gems/pg-0.18.1/ext/gem_make.out
An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.

如何解决这个问题?

检查此 link:whosebug.com/questions/9668753

这对我来说总是有效的,但我也先下载 postgres 并移动到应用程序目录: Postgress.app

安装自制软件

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

如果你不确定你是否有 Homebrew 运行:

brew -v 

如果安装了,你应该得到当前版本,比如 Hombrew 0.9.5

然后 运行:

brew install postgresql

终于:

bundle install

谢谢,但我有解决方案,问题是 32 位与 64 位兼容性。

ARCHFLAGS='-arch x86_64' gem install pg