如何在Mac Snow Leopard中为sqlite3安装ruby界面? [英] How to install ruby interface for sqlite3 in Mac snow leopard?

查看:95
本文介绍了如何在Mac Snow Leopard中为sqlite3安装ruby界面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试按如下所示安装它,但会引发错误:-

I tried to install it as below but it throws error :-

"sudo gem install sqlite3-ruby"
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-ruby-1.3.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out  

有关我的系统的一些信息:-

Some information about my system:-

红宝石-v 1.8.7
导轨-v 3.0.1
宝石-v 1.3.7
sqlite3-版本3.6.12

ruby -v 1.8.7
rails -v 3.0.1
gem -v 1.3.7
sqlite3 --version 3.6.12

还要如何检查我的系统中是否安装了sqlite3的ruby界面?
就像我们用"rails-v"来检查系统中是否安装了rails.我没有在网上找到任何命令来检查系统中是否安装了sqlite3的ruby-interface?

Also how to even check if the ruby interface for sqlite3 is installed in my system?
Like we "rails-v" to check if rails is installed in our system.I didn't find any commands over the web to check if ruby-interface for sqlite3 is installed in my system ?

推荐答案

为了在OS X上编译本机代码(例如本机Ruby扩展),您必须安装Apple XCode.

In order to compile native code on OS X (such as this native Ruby extension) you have to install Apple XCode.

XCode包括各种开发人员工具,例如clang编译器和开发头文件(其中包括ruby.h).

XCode includes various developer tools such as the clang compiler and development header files (ruby.h among others).

XCode的最新版本可在App Store上获得.尽管默认情况下,XCode不再以可从Shell访问它们的方式来安装开发人员工具,但是您可以通过在XCode IDE首选项的下载"选项卡下安装命令行工具" 来解决此问题.窗口.

Recent version of XCode are available on the App Store. Although by default, XCode no longer installs the developers tools in a way that makes them accessible from the shell, you can fix that by installing "Command Line Tools" from under the Download tab of the XCode IDE preference window.

有关更多详细信息,请参见其他答案.

See this other answer for more details.

这篇关于如何在Mac Snow Leopard中为sqlite3安装ruby界面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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