【问题标题】:gem not installing宝石没有安装
【发布时间】:2011-01-17 16:14:33
【问题描述】:

好的,我一直收到这个错误

Could not find tzinfo-0.3.24 in any of the sources (Bundler::GemNotFound)

我正在使用 rvm,我刚刚创建了一个 gemset,我有这个

gem list

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.7)
bcrypt-ruby (2.1.4)
builder (2.1.2)
bundler (1.0.7)
devise (1.1.5)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.14)
mime-types (1.16)
mysql (2.8.1)
paperclip (2.3.8)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
riddle (1.2.2)
thinking-sphinx (2.0.0)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.24)
warden (1.0.3)
will_paginate (3.0.pre2)

我的 Gemfile 是

source 'http://rubygems.org'

gem 'rails', '3.0.3'
gem 'mysql'
gem 'devise'
gem 'thinking-sphinx', '2.0.0', :require => 'thinking_sphinx'
gem "paperclip", "~> 2.3"
gem "will_paginate", "~> 3.0.pre2"

任何想法...直到今天都运行良好

【问题讨论】:

  • tzinfo 0.3.24 刚刚于 2011 年 1 月 15 日发布。它似乎已发布到 ruby​​gems.org 并且对我来说安装正确。
  • 获得同样的东西,但为了主动支持
  • 你是怎么解决这个问题的,我在使用 Devise 后又遇到了同样的问题。
  • 我通过要求 tzinfo 解决了这个问题,而这在需要 activerecord 时通常不需要

标签: ruby-on-rails ruby gem bundler


【解决方案1】:

尝试在 Gemfile 中包含 tzinfo-0.3.24 并使用给出错误的命令执行 bundle exec。或者,您可以捆绑安装 --development 以获取供应商文件夹中的 Gems。让我们知道您的进展情况。

【讨论】:

    【解决方案2】:

    在 DLL Hell 之后,我们有 Gem Hell。看起来我们在 Ruby 中的 dependency hell 与在其他社区中的相同。欢迎:-)

    带有正确版本0.3.24 的 gem tzinfo 似乎丢失了,或者在您的 Gemfile 中没有正确引用它。检查您的 Gemfile 和 Gemfile.lock。后者对于找出依赖关系很有用,如果 Gemfile 发生更改(通过运行捆绑安装),它应该更新。

    如果您使用gem install --user-install gemnamebundle install --path ~/.gem 在本地安装了gem,那么您可能在多个位置有多个gem。通过从命令行调用 gem env 命令来检查 GEM PATHS。

    顺便说一句,您似乎将 Rails 3.0.x 与旧的 mysql gem 一起使用。 mysql2 gem 现在是 Rails 3 中的默认值。我建议使用 mysql2 gem 代替,方法是将 gem 'mysql2' 添加到 GemFile 并在 database.yml 中使用 mysql2 适配器。

    【讨论】:

      猜你喜欢
      • 2017-06-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-27
      • 1970-01-01
      • 1970-01-01
      • 2016-03-23
      • 1970-01-01
      相关资源
      最近更新 更多