Ruby on Rails - sqlite3 gem 安装的问题



>我正在从 Rails 教程中的 rails 教程中学习

使用苹果操作系统

当我尝试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.

我尝试过系统安装,供应商安装。甚至尝试使用自制软件安装 sqlite3 .什么都没用

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

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

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

您的错误信息:

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

邦德不能再继续了,马比这样。

最新更新