部署到heroku时遇到memcachier(memcached)错误

时间:2014-06-17 07:58:44

标签: ruby-on-rails heroku deployment memcached memcachier

Gemfile上的ruby版本是v2.1.2,rails版本是4.1.1

 ruby '2.1.2'
 gem 'rails', '4.1.1'

并且有这样的。

gem "memcachier"
gem 'dalli'

我已经添加了memcachier插件。 但是当我将rails代码部署到heroku时,我遇到了这个错误。

       Installing memcachier 0.0.2

       Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

       /tmp/build_af6f5b6f-490c-4015-8729-49c519b4a44c/vendor/ruby-2.1.2/bin/ruby extconf.rb
       checking for sasl/sasl.h... no
       Please install SASL to continue. The package is called libsasl2-dev on Ubuntu and cyrus-sasl on Gentoo.
       *** 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=/tmp/build_af6f5b6f-490c-4015-8729-49c519b4a44c/vendor/ruby-2.1.2/bin/ruby

       extconf failed, exit code 1

       Gem files will remain installed in /tmp/build_af6f5b6f-490c-4015-8729-49c519b4a44c/vendor/bundle/ruby/2.1.0/gems/memcached-1.8.0 for inspection.
       Results logged to /tmp/build_af6f5b6f-490c-4015-8729-49c519b4a44c/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/memcached-1.8.0/gem_make.out
       Installing newrelic_rpm 3.8.1.221
       Installing kgio 2.9.2
       An error occurred while installing memcached (1.8.0), and Bundler cannot
       continue.
       Make sure that `gem install memcached -v '1.8.0'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !

 !     Push rejected, failed to compile Ruby app

这是什么原因,我该如何避免?

2 个答案:

答案 0 :(得分:0)

我解决了这个问题。 这是因为identity_cache gem。 它依赖于memcached。 所以我把它降级到v0.1.0然后就解决了。

答案 1 :(得分:0)

yum install cyrus-sasl-devel.x86_64