gpt4 book ai didi

ruby - 1.9.3 安装,报错信息 factory_girl requires Ruby version >= 1.9.2

转载 作者:太空宇宙 更新时间:2023-11-03 17:55:43 24 4
gpt4 key购买 nike

我刚刚用 ruby​​ 1.9.3 安装了 rbenv

rbenv version
1.9.3-p327 (set by /Users/me/.rbenv/version)

但是,当我尝试运行 bundle update(在安装 rbenv 之前创建的项目中)时,我收到一条错误消息,指出 factory_girl 至少需要 ruby​​ 1.9.2。请参阅下面的错误消息

如果相关,当我执行 gem --version 时,我会看到对 1.8.23 的引用。

gem --version
1.8.23

错误信息

Installing factory_girl (4.1.0) /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/installer.rb:163:in `install': factory_girl requires Ruby version >= 1.9.2. (Gem::InstallError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:268:in `update'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

更新:

第一个答案告诉我要做三个步骤

gem install bundle
rbenv rehash
bundle install

我做了那些步骤(它安装了 bundler )'

gem install bundler
Fetching: bundler-1.2.3.gem (100%)
Successfully installed bundler-1.2.3
1 gem installed

但是当我尝试“捆绑安装”时,我收到了关于 Factory_girl 的相同错误消息。有趣的是,我决定再次尝试这三个步骤,从 gem install bunlder 开始,它又安装了一次?!#??

最佳答案

您正在使用的 bundle 命令来自系统 Ruby 安装,即 Ruby 1.8.x。

尝试

  1. gem 安装 bundler
  2. rbenv 重新哈希
  3. 捆绑安装

这应该可以解决您的问题。

关于ruby - 1.9.3 安装,报错信息 factory_girl requires Ruby version >= 1.9.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14116083/

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