gpt4 book ai didi

ruby-on-rails - JSON gem : Failing to build gem native extension, Windows 7 上的 bundle 安装失败

转载 作者:行者123 更新时间:2023-12-04 18:03:53 25 4
gpt4 key购买 nike

我正在升级开发机器,因此我正在启动我的新机器并使用我的存储库中的项目运行。我安装了所有需要的软件(Ruby、Devkits 等),安装了基础 gem(bundler 等)并在我的项目文件夹中运行 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 版本,每个版本都会产生相同的错误,所以它开始看起来像是我机器上的东西,但我不知道是什么。

如有任何帮助,我们将不胜感激。下面将包含其他文件/信息

Version Info

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/

Gemfile

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/config

---
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

> 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"

最佳答案

似乎传递 --version 标志来修复编译是真正的错误,因为 evidenced here .

为了在 bundler ​​中模仿这种行为,我们可以使用bundle config:

You can use bundle config to give bundler the flags to pass to the gem installer every time bundler tries to install a particular gem.

...

After running this command, every time bundler needs to install the mysql gem, it will pass along the flags you specified.

尝试运行

bundle config build.json --version
bundle install

这应该会导致 bundler 运行 gem install --verbose json

关于ruby-on-rails - JSON gem : Failing to build gem native extension, Windows 7 上的 bundle 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30383463/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com