一开始我以为是缺少了某个 lib 包(前天硬盘坏了,重新装过系统),然后 stackoverflow 搜了一下,问题依旧没有解决,所以来打扰下诸位聚聚
首先贴上错误的终端信息
Fetching gem metadata from https://rubygems.org/.......
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 10.1.0
·
·
·
Using bootstrap-sass 3.0.3.0
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20160927-13647-olua81json-1.8.1/gems/json-1.8.1/ext/json/ext/generator /usr/local/bin/ruby -r ./siteconf20160927-13647-pqk3gf.rb extconf.rb creating Makefile
current directory: /tmp/bundler20160927-13647-olua81json-1.8.1/gems/json-1.8.1/ext/json/ext/generator make "DESTDIR=" clean
current directory: /tmp/bundler20160927-13647-olua81json-1.8.1/gems/json-1.8.1/ext/json/ext/generator make "DESTDIR=" compiling generator.c In file included from generator.c:1:0: ../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’: ../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given VALUE result = rb_str_new(FBUFFER_PAIR(fb)); ^ ../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [-Wint-conversion] VALUE result = rb_str_new(FBUFFER_PAIR(fb)); ^ Makefile:238: recipe for target 'generator.o' failed make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /tmp/bundler20160927-13647-olua81json-1.8.1/gems/json-1.8.1 for inspection. Results logged to /tmp/bundler20160927-13647-olua81json-1.8.1/extensions/x86_64-linux/2.3.0-static/json-1.8.1/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot
continue.
Make sure that gem install json -v '1.8.1'
succeeds before bundling.
- 然后是我的Gemfile
```Ruby
source 'http://ruby.taobao.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.2'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'json',
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end