Bundler找不到宝石“ bundler”的兼容版本: [英] Bundler could not find compatible versions for gem "bundler":

查看:93
本文介绍了Bundler找不到宝石“ bundler”的兼容版本:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里让Ruby和Rails成为新的人...过去曾经尝试过一些教程,但是仅此而已。我正在尝试遵循 Ruby on Rails 3教程这本书,遇到了一个障碍,在这里和Google上搜索后,我一直找不到任何帮助。

Complete new person to Ruby and Rails here... Have tried some tutorials in the past, but that's about it. I'm trying to follow 'Ruby on Rails 3 Tutorial' book and have hit a roadblock that I haven't been able to find any help for after searching on here and the Google..

我实际上还没有做任何事情;仅:

I haven't actually done anything yet; only:

rails new first_app

然后将Gemfile sqlite3更改为

then changed the Gemfile sqlite3 to

gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

当我运行捆绑安装时,我得到以下信息:

When I run 'bundle install' I get the following:

Fetching gem metadata from http://rubygems.org/.........
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.1) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.1.3)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

我尝试通过

gem uninstall bundler -v 1.1.3

通过

gem install bundler -v 1.0.0

,但似乎让我获得了捆绑器1.1.2。

but it seems to get me bundler 1.1.2..

我只是觉得

任何帮助将不胜感激,并得到大量培根。

Any help would be greatly appreciated and rewarded with copious amounts of bacon...

UPDATE UPDATE UPDATE

UPDATE UPDATE UPDATE

我无法获得捆绑程序v 1.1.2进行卸载。我终于可以通过执行以下操作来卸载所有gems:

I couldn't get bundler v 1.1.2 to uninstall. I finally was able to uninstall all of the gems by doing:

sudo gem list | cut -d" " -f1 > gem_list.txt  
cat gem_list.txt | xargs sudo gem uninstall -aIx  
cat gem_list.txt | xargs sudo gem install

然后重新安装...这使我可以执行捆绑安装并按计划进行。谢谢大家的帮助!

And then reinstalling... This allowed me to then do the 'bundle install' and get on track.. Thank you all for your help!

推荐答案

首先验证您的版本以确保它们是最新版本:

First verify your versions to be sure they're all current:

$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]

$ rails -v          
Rails 3.2.2

$ gem list bundler
*** LOCAL GEMS ***
bundler (1.1.3)

如果需要更新ruby,可以从 https://www.ruby-lang.org 或使用诸如ruby-build之类的工具。如果您有任何版本的Ruby 1.9.3,现在就可以了。

If you need to update ruby, you can download it from https://www.ruby-lang.org or use tools like ruby-build. If you have any version of Ruby 1.9.3 that's fine for now.

要更新所有gem,请执行以下操作:

To update all your gems:

gem update --system
gem update

宝石可能会在几个不同的地方安装宝石,这些宝石会相互干扰。有系统gem(通常由root或使用sudo安装)和您的个人用户gem。我最喜欢的管理这些方法是使用一个名为rbenv的简单工具。一个相关的工具是rvm。都可以。

Gem may install gems in a few different places, and these can interfere with each other. There are system gems (typically installed by root or by using sudo) and your personal user gems. My favorite way to manage these is with a simple tool called rbenv. A related tool is rvm. Either is fine.

对于您的第一个教程,您可以跳过Gemfile中使用的版本号:

For your first tutorial, you can skip using version numbers in your Gemfile:

- gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
+ gem 'sqlite3-ruby', :require => 'sqlite3'

Bundler会正确整理所有内容。最终,如果您要与其他开发人员进行协调或构建生产系统,则需要指定版本号。

Bundler will sort everything out the right way. Eventually you'll want to specify version numbers if you're coordinating with other developers, or building production systems.

请在此处随意提问,我将添加为这个答案。

Feel free to ask questions here and I'll add to this answer.

这篇关于Bundler找不到宝石“ bundler”的兼容版本:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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