繁体   English   中英

Ruby gem安装错误

[英]Ruby gem install error

这是一个错误代码段:

Using jbuilder (1.5.3) Installing jquery-rails (3.1.0) Installing json (1.8.1) Gem::Installer::ExtensionBuildError: ERROR:
Failed to build gem native extension .

    c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: No such file or directory
-- extconf.r b (LoadError)

Gem files will remain installed in
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/json-1.8.1 for
inspection. Results logged to
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.
1/ext/json/ext/generator/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.

输入gem install json -v返回:

'1.8.1' Temporarily enhancing PATH to include DevKit... Building
native extensions.  This could take a while... ERROR:  Error
installing json:
        ERROR: Failed to build gem native extension.

        c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb c:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: No such file or directory
-- extconf.r b (LoadError)


Gem files will remain installed in
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9 .1/gems/json-1.8.1 for
inspection. Results logged to
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/json-1.8.
1/ext/json/ext/generator/gem_make.out

输入bundle install返回:

Bundler::GemfileNotFound

输入cd qwerty返回:

pmakamgovind@CSCINDAE751352 ~/Desktop/ruby/qwerty $ rails s
←[31mCould not find gem 'rails (= 4.0.2) x86-mingw32' in the gems
available on t his machine.←[0m ←[33mRun `bundle install` to install
missing gems.←[0m

尝试在您的Gemfile上添加以下行:gem'json gem 'json', '1.8.1'

然后运行: bundle update覆盖json gem的较新版本。

如果您使用的宝石数量不是很大,那么您可以直接提及Github路径并继续。

或者,下载有问题的特定宝石的Github副本,并制作本地副本供您自己使用。 这样,您就不必依赖rubygems.org来运行您的应用程序。

我也遇到了这个问题,后来才知道该站点在特定时间段内处于关闭状态。

注意-您的错误很可能是由于本地计算机上缺少头文件引起的。 首先,安装SQL和Ruby头文件,然后再次尝试bundle install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM