【问题标题】:Ruby on Rails - issues with sqlite3 gem install [duplicate]Ruby on Rails - sqlite3 gem install 的问题[重复]
【发布时间】:2015-07-01 01:12:31
【问题描述】:

我正在学习Rails Tutorial的rails教程

使用 Mac 操作系统

当我尝试bin/rails server 命令时,我得到以下错误。

bin/rails server
Could not find gem 'uglifier (>= 1.3.0) ruby' in any of the gem sources listed in your Gemfile or installed on this machine.
Run `bundle install` to install missing gems.

当我成功尝试bundle install 命令时,我得到了以下问题。

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for sqlite3.h... yes
checking for sqlite3_libversion_number() in -lsqlite3... no
sqlite3 is missing. Try 'port install sqlite3 +universal',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/
    --with-sqlite3lib
    --without-sqlite3lib


Gem files will remain installed in /Users/lloyd/dev/projects/blog/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
Results logged to /Users/lloyd/dev/projects/blog/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.10), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.

我尝试过系统安装、供应商安装。甚至尝试使用 homebrew 安装 sqlite3 。 . . . .没有任何效果

我该如何解决这个问题并继续前进?

【问题讨论】:

  • 试试'port install sqlite3 +universal''yum install sqlite-devel''apt-get install libsqlite3-dev'
  • 试过了。不工作。如何在 Mac os 中使用 port / yum / apt-get ?
  • 是的,这也是我所怀疑的。我尝试了brew install sqlite3brew install sqlite。仍然没有进展。 Brew 用以下 Mac OS X already provides this software and installing another version in parallel can cause all kinds of trouble.Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables: LDFLAGS: -L/usr/local/opt/sqlite/lib CPPFLAGS: -I/usr/local/opt/sqlite/include 警告我

标签: ruby-on-rails sqlite


【解决方案1】:

我也有这个问题。我终于更改了 Gemfile 中的源以修复它:

# source 'https://rubygems.org'
source 'https://ruby.taobao.org/'

您的错误信息:

安装 sqlite3 (1.3.10) 和 Bundler 时出错 无法继续。确保gem install sqlite3 -v '1.3.10' 在捆绑之前成功。

Bunder 无法继续,可能是这样。

【讨论】:

    猜你喜欢
    • 2011-08-26
    • 2013-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-19
    • 2013-10-02
    • 1970-01-01
    相关资源
    最近更新 更多