Bundle说宝石不见了 - 但它不是? [英] Bundle says gem is missing - but it's not?

查看:112
本文介绍了Bundle说宝石不见了 - 但它不是?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我维护Ruby On Rails网站的内容,但我确实没有使用rails的经验。

当试图运行rails服务器时: rails s 我得到这个:


无法在任何来源中找到activesupport-3.2.0
$ b

运行安装缺少的宝石


运行bundle install


Gem :: InstallError:factory_girl需要Ruby版本> = 1.9.2。安装factory_girl(3.2.0)时发生
错误,Bundler
无法继续。



确保 gem安装factory_girl -v'3.2.0'
在捆绑之前成功。


好的安装factory_girl按照说明:


成功安装了factory_girl-3.2.0
1个安装了gem

再次运行bundle install:
$ b


Gem :: InstallError:factory_girl
需要Ruby版本> = 1.9.2。安装
factory_girl(3.2.0)时发生错误,并且Bundler无法继续。确保 gem
在捆绑之前成功安装factory_girl -v'3.2.0'


从头开始求助于StackOverflow。你有什么主意吗?任何帮助都非常感谢。



信息

昨天,尝试运行rails服务器时发生错误。所以按照这个SO建议我的建议我已经加入了RVM并安装了rbenv和打包机,而不是RVM。



我已经尝试了Ruby 1.9.3-p125和1.9.3-rc1



gem list 的输出结果显示factory_girl已安装。


  • ...

  • factory_girl(3.2.0)
  • ...



gem environment 的输出显示这个问题可能与ruby 1.9.1被安装时有所不同?



< blockquote>

RubyGems环境:

- RUBYGEMS VERSION:1.8.10

- RUBY VERSION:1.9.3(2011-09-23 patchlevel -1) [x86_64-darwin11.3.0]

- 安装目录:/Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1

- RUBY EXECUTABLE:/Users/andreas/.rbenv/versions/1.9.3-rc1/bin/ruby

- 可执行目录:/Users/andreas/.rb env / versions / 1.9.3-rc1 / bin

- RUBYGEMS平台:

- ruby​​

- x86_64-darwin-11

- 创业板路径:

- /Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1

- / Users / andreas /.gem/ruby/1.9.1

- GEM配置:

- :update_sources => true

- :verbose => true

- :benchmark => false

- :backtrace => false

- :bulk_threshold => 1000

- gem=> - -no-ri --no-rdoc

- 远程来源:

- http://rubygems.org/


非常感谢任何帮助。

解决方案

@jdoe在评论中回答。它的工作。显然我需要删除 Gemfile.lock



我不知道为什么或者怎么做。我只是在这里发布,直到@jdoe出现并收集他的观点并给出真实答案。


Background

I am maintaining the content of a Ruby On Rails site, but I really have no experience with rails.

When trying to run the rails server: rails s I get this:

Could not find activesupport-3.2.0 in any of the sources

Run bundle install to install missing gems

I run bundle install

Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. An error occured while installing factory_girl (3.2.0), and Bundler cannot continue.

Make sure that gem install factory_girl -v '3.2.0' succeeds before bundling.

Okay install factory_girl as per the instructions:

Successfully installed factory_girl-3.2.0 1 gem installed

run bundle install again:

Gem::InstallError: factory_girl requires Ruby version >= 1.9.2. An error occured while installing factory_girl (3.2.0), and Bundler cannot continue. Make sure that gem install factory_girl -v '3.2.0' succeeds before bundling.

Scratch head and ask for help on StackOverflow. Do you have any idea? Any help is much appreciated.

Info

Yesterday I got a cross-tread error when trying to run rails server. So as per this SO advice I advice I've nuked RVM and installed rbenv and bundler instead of RVM.

I have tried with both Ruby 1.9.3-p125 and 1.9.3-rc1

Output of gem list shows factory_girl as installed.

  • ...
  • factory_girl (3.2.0)
  • ...

Output of gem environmentshows the problem might has something todo with ruby 1.9.1 being installed also?

RubyGems Environment:
- RUBYGEMS VERSION: 1.8.10
- RUBY VERSION: 1.9.3 (2011-09-23 patchlevel -1) [x86_64-darwin11.3.0]
- INSTALLATION DIRECTORY: /Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /Users/andreas/.rbenv/versions/1.9.3-rc1/bin/ruby
- EXECUTABLE DIRECTORY: /Users/andreas/.rbenv/versions/1.9.3-rc1/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/andreas/.rbenv/versions/1.9.3-rc1/lib/ruby/gems/1.9.1
- /Users/andreas/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://rubygems.org/

Any help is much appreciated.

解决方案

@jdoe answered in the comments. And it worked. Apparently I needed to delete Gemfile.lock.

I don't know why or how though. I am just posting this here, until @jdoe shows up and collects his points with a real answer.

这篇关于Bundle说宝石不见了 - 但它不是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆