【发布时间】:2015-05-21 20:11:50
【问题描述】:
我正在升级开发机器,因此我正在启动我的新机器并与我的项目一起运行来自 repo 的项目。我安装了所有需要的软件(Ruby、Devkits 等),安装了基础 gem(捆绑程序等)并在我的项目文件夹中运行 bundle install,产生了这个错误:
> bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from http://rubygems.org/.........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Resolving dependencies.....
Using rake 10.4.2
Using i18n 0.7.0
Using multi_json 1.11.0
Using activesupport 3.2.21
Using builder 3.0.4
Using activemodel 3.2.21
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.3
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.2.3
Using actionpack 3.2.21
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 3.2.21
Using arel 3.0.3
Using tzinfo 0.3.44
Using activerecord 3.2.21
Using activerecord-sqlserver-adapter 3.2.13
Using activeresource 3.2.21
Using authlogic 3.2.0
Using execjs 2.0.2
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
Gem files will remain installed in C:/Code/vampire_its/ios/.bundle/gems/ruby/2.0.0/gems/json-1.8.2 for inspection.
Results logged to C:/Code/vampire_its/ios/.bundle/gems/ruby/2.0.0/gems/json-1.8.2/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.
我已经研究了一段时间的解决方案并尝试了运行gem install json --verbose 的建议解决方案,它确实正确安装了json gem。但是,如果不运行 bundle install,它就不会正确添加到我的包中。我什至跑了bundler install --verbose,但实际上失败了,所以我很难弄清楚发生了什么。实际上,我已经尝试过每一个我能拿到手的 Ruby 版本,每个版本都会产生相同的错误,所以它开始看起来像是我机器上的东西,但我不知道是什么。
任何帮助将不胜感激。其他文件/信息将包含在下面
版本信息
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2014-11-13 patchlevel 598) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby200/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: C:/Ruby200/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby200/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby200/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "gempath" => "C:/Ruby200/lib/ruby/gems/2.0.0"
- REMOTE SOURCES:
- https://rubygems.org/
宝石文件
source 'http://rubygems.org'
gem 'rails', '3.2.21'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3', '~>1.3.7'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'
# Bundle the extra gems:
gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'
# Rake 0.9.1 breaks Rails
gem 'rake', '>=0.9.2'
group :development do
gem 'rspec-rails', '2.5.0'
gem 'factory_girl', '~> 2.5.0'
gem 'rails-erd', '~>1.1.0', :require => false
gem 'ruby_parser', '~>3.1.1', :require => false # seems to be an implicit dependency of rails-erd
gem 'pry', '~>0.9.12.6'
gem 'pry-rails', '~>0.2.2'
gem 'pry-nav', '~>0.2.3'
gem 'pry-doc', '~>0.5.1'
gem 'xml-simple', '~> 1.1.4'
end
gem "paperclip", "~>2.7.0"
gem "rubyzip", "~>0.9.9"
group :test do
#gem 'capybara', '~> 1.1.4'
gem 'rspec', '2.5.0'
gem 'webrat', '0.7.1'
gem "faker", '1.2.0'
#gem "factory_girl", '~> 2.5.0'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'execjs', '~>2.0.2'
gem 'uglifier', '~>1.3.0'
gem "jquery-rails", '~>3.0.0'
gem 'jquery-ui-rails'
gem 'underscore-rails'
gem "backbone-rails"
end
gem 'authlogic', '~>3.2.0'
gem "declarative_authorization", '~>0.5.6'
gem "sys-filesystem", '1.0.0'
gem "dynamic_form" , '~>1.1.4'
gem 'client_side_validations', '~>3.2.1'
gem "rest-client", '~>1.6.7', :require => "rest_client"
gem "httpclient"
gem 'd3-rails', '~>0.0.5'
gem 'bindata', '~>1.4.5'
gem 'eventmachine', '~>1.0.7', :require => false
if RUBY_PLATFORM =~ /darwin/
#gem "geotrans", "0.0.1" , :path => '../geotrans/pkg/geotrans-0.0.1-x86_64-darwin-12'
elsif RUBY_PLATFORM =~ /(win|w)32$/
gem "geotrans", "0.0.2" , :path => '../geotrans/pkg/geotrans-0.0.2-x86-mingw32'
end
gem "unit_conversion", :path => "./local-gems/unit_conversion"
# RGeo for geographic data support
if RUBY_PLATFORM =~ /(win|w)32$/
gem 'rgeo', "0.3.14" , :path => '../rgeo/pkg/rgeo-0.3.14'
else
gem 'rgeo', '~>0.3.14'
end
# SQL Server support
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter', '~>3.2.10'
# test coverage
if RUBY_VERSION =~ /1.8/
gem 'rcov', '~>1.0.0', :require => false, :group => :test
else
gem 'simplecov', :require => false, :group => :test
end
gem 'delayed_job_active_record', '~>0.3.3'
gem "orderedhash", '~>0.0.6' # binary types uses this
gem "nokogiri", '~> 1.5.9'
gem "js-routes", '~> 0.8.8'
gem "numbers_and_words"
gem "gon", '~> 4.1.1'
gem "bootstrap-sass"
gem 'autoprefixer-rails'
.bundle/配置
---
BUNDLE_BIN: .bundle/bin
BUNDLE_PATH: .bundle/gems
BUNDLE_DISABLE_SHARED_GEMS: '1'
C:\Code\vampire_its\ios.bundle\gems\ruby\2.0.0\gems\json-1.8.2\ext\json\ext\generator\gem_make.out
C:/Ruby200/bin/ruby.exe extconf.rb
捆绑配置
> bundle config
DL is deprecated, please use Fiddle
Settings are listed in order of priority. The top value will be used.
build.json
Set for the current user (C:/Users/Micah Cleveland/.bundle/config): "--version"
bin
Set for your local app (C:/Code/vampire_its/ios/.bundle/config): ".bundle/bin"
path
Set for your local app (C:/Code/vampire_its/ios/.bundle/config): ".bundle/gems"
disable_shared_gems
Set for your local app (C:/Code/vampire_its/ios/.bundle/config): "1"
【问题讨论】:
-
它不是要求您使用
--verbose标志进行安装。它要求您使用-v标志进行安装,该标志指示 json gem 的特定版本。尝试安装运行完整的命令:gem install json -v '1.8.2' -
@MartinKonecny,我研究了其他有同样问题的人,建议的解决方案是使用
--verbose标签。简单地使用不带详细标志的gem install json -v '1.8.2'会产生与bundle install相同的错误。相信我,我试过了。 -
我并不是说它会解决你的问题。我是说这将帮助我们诊断那个特定的有问题的版本出了什么问题。你能运行
--verbose和-v '1.8.2'标志吗 -
@MartinKonecny 是的,这就是我成功安装它的方式。 json gem 的 1.8.2 版本实际上只是 gem 的最新版本。我没有发布“成功”安装,因为由于
verbose标志,它非常非常长 -
有趣 - 所以只需传入额外的
--verbose标志而不删除任何其他标志即可解决问题?
标签: ruby-on-rails ruby json gem bundler