在OS X Lion上与sqlite3 gem苦苦挣扎 [英] Struggling with sqlite3 gem on OS X Lion

查看:61
本文介绍了在OS X Lion上与sqlite3 gem苦苦挣扎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Mac和Ruby on Rails的新手,我正在尝试设置我的环境.我一直在研究本教程,并且一直试图在Mac OS X Lion上安装sqlite3 gem.

I'm new to Mac and Ruby on Rails and I'm trying to set up my environment. I've been working through this tutorial and am stuck trying to get the sqlite3 gem installed on Mac OS X Lion.

  • Xcode 4.2.1
  • git版本1.7.5.4
  • Ruby 1.9.3p0
  • gem -v结果为1.8.11
  • sqlite版本3.7.5

当我尝试运行 gem install sqlite3 gem install sqlite3---with-sqlite3-dir =/usr/bin 时,出现以下错误文本,有人有什么建议吗?

When I try to run gem install sqlite3 or gem install sqlite3 -- --with-sqlite3-dir=/usr/bin I get the error text below, does anyone have any suggestions?

Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
ERROR: Failed to build gem native extension.

    /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb --with-sqlite3-dir=/usr/bin
checking for sqlite3.h... *** 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=/Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
--with-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
--enable-local
--disable-local
/Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:970:in `block in find_header'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/mikehking/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:969:in `find_header'
from extconf.rb:34:in `<main>'


Gem files will remain installed in /Users/mikehking/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.5 for inspection.
Results logged to /Users/mikehking/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out

推荐答案

您将需要sqlite3库文件,我想它应该和运行一样简单

You are going to need the sqlite3 library files, which I imagine should be as simple as running

 sudo brew install libsqlite3-dev

这篇关于在OS X Lion上与sqlite3 gem苦苦挣扎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆