【问题标题】:ROR Bundle Install will not install missing gemsROR Bundle Install 不会安装缺少的 gem
【发布时间】:2011-06-19 15:17:08
【问题描述】:

尝试在我的机器上启动 rails 服务器时,我得到以下信息:

Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
Run `bundle install` to install missing gems.

这是尝试捆绑安装时收到的错误

bundle install
Fetching source index for http://rubygems.org/
Using rake (0.9.2) 
Using abstract (1.0.0) 
Using activesupport (3.0.9) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.9) 
Using erubis (2.6.6) 
Using rack (1.2.3) 
Using rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.28) 
Using actionpack (3.0.9) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.19) 
Using actionmailer (3.0.9) 
Using arel (2.0.10) 
Using activerecord (3.0.9) 
Using activeresource (3.0.9) 
Using bundler (1.0.15) 
Using rdoc (3.6.1) 
Using thor (0.14.6) 
Using railties (3.0.9) 
Using rails (3.0.9) 
Installing sqlite3 (1.3.3) /Library/Ruby/Site/1.8/rubygems/installer.rb:584:in         `initialize': Permission denied - /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/API_CHANGES.rdoc (Errno::EACCES)
from /Library/Ruby/Site/1.8/rubygems/installer.rb:584:in `open'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:584:in `extract_files'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:564:in `each'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:564:in `extract_files'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:179:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/cli.rb:222:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

我试过了:

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 在以下位置找不到 ruby​​ 的头文件 /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-1.3.3 for    inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out

【问题讨论】:

    标签: ruby-on-rails sqlite osx-snow-leopard bundle


    【解决方案1】:

    这些是您必须执行的步骤:

    1. here 安装 MacPorts
    2. 从命令行运行“port install sqlite3 +universal”
    3. 从命令行运行“gem install sqlite3-ruby”
    4. 转到您的应用程序文件夹“rails server”,瞧!您应该会看到您的服务器正在启动

    【讨论】:

    【解决方案2】:

    Mohit 的回答对我不起作用,但我最终通过简单地删除 /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3 文件夹并再次运行“捆绑安装”来解决同样的问题。成功!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多