macos 如何在 Mac OS X Lion 上安装 Sqlite3
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7698692/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install Sqlite3 on Mac OS X Lion
提问by Matt
I am having a hell of a time getting SQLite3 installed. I have gotten all the latest stuff in terms of Ruby and Rails, the gems, etc. Everything says "Nothing to update". But when I try to install the DB I have the following error:
我在安装 SQLite3 时遇到了麻烦。我已经获得了 Ruby 和 Rails、gems 等方面的所有最新内容。一切都说“没有什么可更新”。但是当我尝试安装数据库时,出现以下错误:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out
回答by Oleksandr Skrypnyk
Did you have SQLite3 installed in system?
你有没有在系统中安装 SQLite3?
If you're using MacPorts:
如果您使用的是 MacPorts:
sudo port install sqlite3
or Brew:
或酿造:
brew install sqlite3
回答by lmiguelvargasf
In order to install sqlite3
on Mac using brew
, you can simply run:
为了使用 安装sqlite3
在 Mac 上brew
,您只需运行:
$ brew install sqlite3
Probably, you have already installed sqlite3
because by default it comes installed since Mac OSX 10.4 onwards. In this case, you can update sqlite3
using brew
by running the following command:
可能您已经安装了,sqlite3
因为默认情况下它是从Mac OSX 10.4 开始安装的。在这种情况下,您可以通过运行以下命令来更新sqlite3
使用brew
:
$ brew upgrade sqlite3
回答by Matt
I did not have XCode 4 installed, but version 3 instead. After installing 4 I am good to go.
我没有安装 XCode 4,而是安装了版本 3。安装 4 后我就可以开始了。