安装Sqlite3 for Ruby(Mac OSX 10.5.8) [英] Installing Sqlite3 for Ruby (Mac OSX 10.5.8)

查看:90
本文介绍了安装Sqlite3 for Ruby(Mac OSX 10.5.8)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用本指南的ATM- http ://guides.rubyonrails.org/getting_started.html#getting-up-and-running-quickly-with-scaffolding

I am following this guide ATM - http://guides.rubyonrails.org/getting_started.html#getting-up-and-running-quickly-with-scaffolding

当尝试创建数据库时,我得到了:

When trying to create a database, I got:

Morgans-Computer:blog Morgan $ rake db:create 在Gemfile中列出的任何gem来源中都找不到gem'sqlite3(> = 0)'. 运行bundle install安装缺少的gem.

Morgans-Computer:blog Morgan$ rake db:create Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile. Run bundle install to install missing gems.

当我尝试运行捆绑安装"时,出现更多错误:

When I try to run 'bundle install', I get more errors:

使用本地扩展名/users/Morgan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in安装sqlite3(1.3.4) `build_extensions中的块中营救':错误:无法生成gem本机扩展. (Gem :: Installer :: ExtensionBuildError)

Installing sqlite3 (1.3.4) with native extensions /Users/Morgan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:551:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

    /Users/Morgan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb 

我尝试安装Ruby Gem Sqlite3(http://rubygems.org/gems/sqlite3-ruby),但它仍然失败.我在这里找到另一篇文章,说我需要安装C,因为那是编译器编写的内容?不确定究竟是什么意思,还是我将如何去做.

I have tried to install the Ruby Gem Sqlite3 (http://rubygems.org/gems/sqlite3-ruby) but it continues to fail. I found another post on here saying that I need to install C because that is what the compiler is written in? Wasn't sure exactly what that meant, or how I go about doing it.

任何帮助将不胜感激!

推荐答案

如果您还没有 homebrew 已安装,我将首先对其进行设置.这是一个不错的软件包管理器,允许您使用brew install sqlite安装sqlite之类的东西.

If you don't already have homebrew installed, I would set that up first. It's a nice package manager and allows you to install things like sqlite with brew install sqlite.

要安装brew,您需要安装xcode.如果还没有,则可能需要系统附带的CD,或者可以从下载苹果的网站.在最新的操作系统上,您可以从App Store安装它,这很好(这可能也对您有用).

To install brew you'll need xcode installed. If you don't already have that you'll probably need the cd that came with you system, or you can download from apple's website. On the latest OS, you can install it from the App Store which is nice (This might work for you too).

如果您拥有mysql,并且更愿意使用它并回避sqlite问题,则可以这样生成rails项目.

If you have mysql and would prefer to use that instead and sidestep the sqlite issue you can generate your rails project as such.

rails new my_new_project -d mysql

这篇关于安装Sqlite3 for Ruby(Mac OSX 10.5.8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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