简体   繁体   English

无法安装ffi gem,Rails失败

[英]Can't install ffi gem, Rails fail

While creating creating an integration test via rails generate integration_test foo it declined with 在通过rails generate integration_test foo创建集成测试时, rails generate integration_test foo但它拒绝了

Could not find ffi-1.0.9 in any of the sources
Run `bundle install` to install missing gems.

I ran bundle install to install missing gems, but with no success. 我运行bundle install来安装缺少的gem,但没有成功。 Still the same error. 还是一样的错误。 I have gem 'ffi' in my Gemfile. 我的Gemfile中有gem'ffi gem 'ffi'

I switched the gemfile line to gem 'ffi', :git => 'git://github.com/ffi/ffi.git' and bundle install ed again. 我将gemfile行切换为gem'ffi gem 'ffi', :git => 'git://github.com/ffi/ffi.git'并再次bundle install ed。 It did all sort of stuff and wrote "Your bundle is complete" at the end. 它完成了各种各样的事情并在最后写了“你的包完整”。

However when I run the rails generate... command again I get: 但是,当我再次运行rails generate...命令时,我得到:

git://github.com/ffi/ffi.git (at master) is not checked out. Please run 'bundle install'

What the hell is going on with this ffi? 这个ffi到底是怎么回事?

我遇到了同样的问题并通过删除Gemfile.lock并重新运行bundle install来解决它。

bundle install was failing because it could ffi failed with NoMethodError for spec. 捆绑安装失败,因为它可能因为规范的NoMethodError而失败。

Removing Gemfile.lock, empty the gemset and doing bundle install worked. 删除Gemfile.lock,清空gemset并进行bundle install工作。

也许尝试'捆绑exec rails generate ...'

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

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