Fol*_*ken 16 ruby sqlite gem ruby-on-rails sqlite3-ruby
我正在尝试在OS X 10.6上安装"sqlite3-ruby"gem(或"sqlite3"gem).我正在使用ruby-1.9.2,目前我得到以下内容:
$ sqlite3 --version
3.7.4
$ sudo gem install sqlite3
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/Users/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb
checking for sqlite3.h... *** 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=/Users/folken/.rvm/rubies/ruby-1.9.2-head/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}/lib
/Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:28:in `<main>'
Gem files will remain installed in /Users/folken/.rvm/gems/ruby-1.9.2-head/gems/sqlite3-1.3.3 for inspection.
Run Code Online (Sandbox Code Playgroud)
以下是其中&whereis的结果,sqlite3.h位于/ opt/local/include中:
$ which sqlite3
/opt/local/bin/sqlite3
$ whereis sqlite3
/usr/bin/sqlite3
Run Code Online (Sandbox Code Playgroud)
我也试过传递以下内容:
sudo gem install sqlite3 -- --with-sqlite3-include /opt/local/include --with-sqlite3-lib /opt/local/lib
sudo gem install sqlite3 -- --with-sqlite3-dir /opt/local/bin
Run Code Online (Sandbox Code Playgroud)
这导致以下结果:
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
/Users/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb --with-sqlite3-dir /usr/bin/sqlite3
*** 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=/Users/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby
--with-sqlite3-dir
/Users/folken/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:1336:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
from extconf.rb:9:in `<main>'
Run Code Online (Sandbox Code Playgroud)
也在/Users/folken/.rvm/gems/ruby-1.9.2-head/gems下:sqlite-ruby-2.2.3 sqlite3-1.3.3
在RVM下我有ruby-1.8.7并且sqlite3 gem加载得很好,但经过大量的谷歌搜索后我还没有找到适合我的解决方案.非常感谢任何帮助(即使它涉及手动安装/ hackery工作).
Moi*_*aja 15
我有一个几乎类似的问题,因为我安装了sqlite3,但sqlite3 gem无法安装.我看到如下错误信息,
user-name-rajas-macbook-pro:rails3 user-namer$ gem install sqlite3
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/Users/user-namer/.rvm/rubies/ruby-1.9.2-p180/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'
or 'yum install sqlite3-devel' 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
--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=/Users/user-namer/.rvm/rubies/ruby-1.9.2-p180/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}/lib
--with-sqlite3lib
--without-sqlite3lib
Gem files will remain installed in /Users/user-namer/.rvm/gems/ruby-1.9.2- p180@rails_3/gems/sqlite3-1.3.3 for inspection.
Results logged to /Users/user-namer/.rvm/gems/ruby-1.9.2-p180@rails_3/gems/sqlite3- 1.3.3/ext/sqlite3/gem_make.out
Run Code Online (Sandbox Code Playgroud)
这对我有用
gem install sqlite3 -- --with-sqlite3-dir=/opt/local
Run Code Online (Sandbox Code Playgroud)
我使用ruby 1.9.2.p180和使用Mac OS X 10.5.8(Leopard)使用ruby 1.9.2.p180和rails 3.1.0.rc6跟踪Rails3 in Action一书,当我跑步时:
rake cucumber:ok
Run Code Online (Sandbox Code Playgroud)
我有:
Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (can't activate sqlite3 (~> 1.3.4, runtime), already activated sqlite3-1.3.3. Make sure all dependencies are added to Gemfile.)
Run Code Online (Sandbox Code Playgroud)
然后我做了:
gem install sqlite3 -- --with-sqlite3-dir=/opt/local
Run Code Online (Sandbox Code Playgroud)
其次是:
bundle install
Run Code Online (Sandbox Code Playgroud)
希望在需要sqlite 1.3.5时,我会在Internet上找到自己的答案.
| 归档时间: |
|
| 查看次数: |
19612 次 |
| 最近记录: |