gpt4 book ai didi

ruby - 错误 : Installing vagrant gem in ruby 2. 0.0

转载 作者:数据小太阳 更新时间:2023-10-29 07:27:15 26 4
gpt4 key购买 nike

当我尝试在 ruby 2.0.0-p0 中安装 vagrant gem 时,出现以下错误:

~ ruby -v
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]
~ gem -v
2.0.0.rc.2
~ gem list json
*** LOCAL GEMS ***
json (1.7.7)

~ gem install vagrant
Building native extensions. This could take a while...
ERROR: Error installing vagrant:
ERROR: Failed to build gem native extension.

/home/user_name/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb
checking for ruby/re.h... yes
checking for ruby/encoding.h... yes
creating Makefile
make
compiling generator.c
generator.c: In function ‘cState_aref’:
generator.c:736:5: warning: variable ‘state’ set but not used [-Wunused-but-set-variable]
linking shared-object json/ext/generator.so
make install
/usr/bin/install -c -m 0755 generator.so /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext
/usr/bin/install: cannot create regular file `/home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext': No such file or directory
make: *** [install-so] Error 1
Gem files will remain installed in /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5 for inspection.
Results logged to /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/generator/gem_make.out

我想,它在构建 gem 时使用/home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/中的 json-1.5.5 并出现上述错误.

我尝试重新安装最新的 json-1.7.7 gem,但仍然无法安装。

最佳答案

使用以下命令更新您的 ruby​​gems:gem update --system

这是修复此问题的提交:https://github.com/rubygems/rubygems/commit/1ca11d00833bbca33215ff581303d1fee8f2d1ef

关于ruby - 错误 : Installing vagrant gem in ruby 2. 0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15277135/

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