2014-02-05 169 views
1

这是一个错误片段:红宝石创业板安装错误

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 

进入​​回报:

[email protected] ~/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 
+0

我想你是从错误的目录安装bundle gems,如果你已经创建了一个新的rails应用程序,然后cd进入它,然后做捆绑安装 –

+0

你有没有使用rvm/rbenv? –

+0

你有什么环境? Windows/Linux? –

回答

1

尝试添加此行对你的Gemfile: gem 'json', '1.8.1'

然后运行:bundle update覆盖JSON宝石的新版本。

+0

我已经将这行添加到gemfile中并保存。尝试运行“捆绑安装”也..它仍然显示如下。 pmakamgovind @ CSCINDAE751352〜/桌面/红宝石/ QWERTY $捆绑安装 从https抓取宝石元数据://rubygems.org/.......... 从https抓取宝石元数据:// RubyGems的。 org/.. 正在解决依赖关系... 在此机器上可用的宝石中找不到gem'Json(= 1.8.1)x86-mingw32'。 – PraveenMakam

0

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

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

我也遇到过这个问题,后来才知道该网站在这段时间内停滞了。

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

+1

为了可读性,请拼出“你”。因为你没有花时间写清楚,“l33t”会让人们打折说你不得不说的话。请记住,雇主和潜在的人也会阅读这些答案。 –

+0

将来要记住这一点,谢谢指出:) –