无法安装 ffi gem,Rails 失败
在通过railsgenerateintegration_testfoo
创建集成测试时,它拒绝了,
Could not find ffi-1.0.9 in any of the sources
Run `bundle install` to install missing gems.
我运行bundleinstall
来安装缺少的gems,但没有成功。还是同样的错误。我的 Gemfile 中有 gem 'ffi'
。
我将 gemfile 行切换为 gem 'ffi', :git => 'git://github.com/ffi/ffi.git' 并再次捆绑安装
。它做了各种各样的事情,并在最后写道“您的捆绑包已完成”。
但是,当我再次运行 railsgenerate...
命令时,我得到:
git://github.com/ffi/ffi.git (at master) 未签出。请运行“bundle install”
这个 ffi 到底是怎么回事?
While creating creating an integration test via rails generate integration_test foo
it declined with
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. Still the same error. I have gem 'ffi'
in my Gemfile.
I switched the gemfile line to gem 'ffi', :git => 'git://github.com/ffi/ffi.git'
and bundle install
ed again. 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:
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,并通过删除
Gemfile.lock
并重新运行bundle install
解决了它。I ran into the same problem and solved it by removing the
Gemfile.lock
and re-runbundle install
.也许尝试“bundle execrailsgenerate...”
Perhaps try 'bundle exec rails generate...'
捆绑包安装失败,因为它可能因规范的 NoMethodError 而失败。
删除 Gemfile.lock,清空 gemset 并进行捆绑安装工作。
bundle install was failing because it could ffi failed with NoMethodError for spec.
Removing Gemfile.lock, empty the gemset and doing bundle install worked.