gem安装patron错误

NameNoteFound 2014-09-01 01:21:58
运行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
...全文
664 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
NameNoteFound 2014-09-01
  • 打赏
  • 举报
回复
不用了...自己找到了,先运行sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev后bundle就可以了 参考http://stackoverflow.com/questions/10184615/cant-find-libcurl-or-curl-curl-h-runtimeerror

2,763

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ruby/Rails
社区管理员
  • Ruby/Rails社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧