gem安装patron错误
运行sudo gem install patron -v '0.4.18'显示错误信息:
Fetching: patron-0.4.18.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/local/lib/ruby/gems/2.1.0 dire ctory.
wyx@ubuntu:~/Project/SmartAgent$ sudo gem install patron -v '0.4.18'
Building native extensions. This could take a while...
ERROR: Error installing patron:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** 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=/usr/local/bin/ruby
--with-curl-dir
--without-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
--with-curllib
--without-curllib
extconf.rb:34:in `<main>': Can't find libcurl or curl/curl.h (RuntimeError)
Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
options to extconf.
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.1.0/gems/patron-0. 4.18 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-s tatic/patron-0.4.18/gem_make.out