乘客:“缺少这些必需的宝石redgreen”

时间:2021-06-20 11:03:50

total ruby newbie, trying to setup a Rails/MongoDB application on Mac OS X Snow leopard.

总ruby新手,尝试在Mac OS X Snow leopard上设置Rails / MongoDB应用程序。

Installed Ruby 1.9.1 and RubyGems 1.3.7, which ruby and which gem point to the same directory. I'm using the Snow Leopard built-in apache and Passenger 2.2.11. I'm using the rails template from the mongo-site which seems to work okay overall.

安装了Ruby 1.9.1和RubyGems 1.3.7,其中ruby和哪个gem指向同一目录。我正在使用Snow Leopard内置的apache和Passenger 2.2.11。我正在使用mongo-site的rails模板,这似乎总体上可以正常工作。

The exact error that passenger gives me is:

乘客给我的确切错误是:

/Users/User/Sites/feuerapp/vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement **Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance. You can install the extension as follows: gem install bson_ext If you continue to receive this message after installing, make sure that the bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version. Missing these required gems: redgreen You're running: ruby 1.9.1.376 at /usr/local/bin/ruby rubygems 1.3.7 at /Users/User/.gem/ruby/1.9.1, /usr/local/lib/ruby/gems/1.9.1 Runrake gems:installto install the missing gems.

/Users/User/Sites/feuerapp/vendor/rails/railties/lib/rails/gem_dependency.rb:119:Warning:Gem :: Dependency#version_requirements已弃用,将于2010年8月或之后删除。使用#requirement **注意:未加载C扩展名。这是最佳MongoDB Ruby驱动程序性能所必需的。您可以按如下方式安装扩展:gem install bson_ext如果在安装后继续收到此消息,请确保bson_ext gem位于加载路径中,并且bson_ext和mongo gem的版本相同。缺少这些必需的宝石:redgreen你正在运行:ruby 1.9.1.376 at / usr / local / bin / ruby​​ ruby​​gems 1.3.7 at /Users/User/.gem/ruby/1.9.1,/ usr / local / lib / ruby / gems / 1.9.1 Runrake gems:install安装缺少的宝石。

The weird thing is that redgreen is installed and looks fine to me:

奇怪的是安装了redgreen并且对我来说很好看:

Dahlia:feuerapp User$ ls -la vendor/gems/
total 0
drwxr-xr-x 7 User staff 238 May 18 22:56 .
drwxr-xr-x 5 User staff 170 May 18 23:00 ..
drwxr-xr-x 11 User staff 374 May 18 22:56 factory_girl-1.2.4
drwxr-xr-x 11 User staff 374 May 18 22:56 mocha-0.9.8
drwxr-xr-x 7 User staff 238 May 18 22:56 mongo_mapper-0.7.6
drwxr-xr-x 7 User staff 238 May 18 22:56 redgreen-1.2.2
drwxr-xr-x 11 User staff 374 May 18 22:56 shoulda-2.10.3

Dahlia:feuerapp用户$ ls -la vendor / gems / total 0 drwxr-xr-x 7用户工作人员238 May 18 22:56。 drwxr-xr-x 5用户工作人员170 5月18日23:00 .. drwxr-xr-x 11用户工作人员374 5月18日22:56 factory_girl-1.2.4 drwxr-xr-x 11用户工作人员374 5月18日22:56摩卡-0.9.8 drwxr-xr-x 7用户工作人员238 5月18日22:56 mongo_mapper-0.7.6 drwxr-xr-x 7用户工作人员238 5月18日22:56 redgreen-1.2.2 drwxr-xr-x 11用户工作人员374年5月18日22:56 shoulda-2.10.3

Commenting out this line in environment.rb "solves" the issue, but that's not really want I want:

在环境中评论这一行.rb“解决”了这个问题,但这并不是我想要的:

config.gem 'redgreen'

I don't understand anything of gems yet, but from my limited understanding, redgreen should be there and found?

我对宝石一无所知,但从我有限的理解,redgreen应该在那里找到?

2 个解决方案

#1


3  

Okay, found it, I was missing the test-unit gem.

好吧,发现它,我错过了测试单元宝石。

How I found it? I went to vendor/gems/redgreen-1.2.2/lib/redgreen.rb and looked at the "require" statements, which lists "test/unit". Quick googling led me to the test-unit gem, and after gem install test-unit it works now.

我怎么找到的?我去了vendor / gems / redgreen-1.2.2 / lib / redgreen.rb并查看了“require”语句,其中列出了“test / unit”。快速谷歌搜索引导我到测试单元宝石,并在宝石安装测试单元后,它现在工作。

I'm not sure if I can tell rake somehow that there is a dependency and I'm a bit disappointed that there was no better error message, but at least that's resolved now.

我不确定我是否能以某种方式告诉rake存在依赖关系而且我有点失望,因为没有更好的错误消息,但至少现在已经解决了。

#2


0  

Perhaps it's not telling you that it's looking for a different version of the gem for whatever reason. If you run (sudo) rake gems:install and try again, do you get the same message? The gem dependency business is a bit of a pain in the ass, to say the least.

也许它并没有告诉你,无论出于何种原因,它正在寻找不同版本的宝石。如果你运行(sudo)rake gems:安装并再试一次,你会得到相同的消息吗?至少可以说,宝石依赖企业在屁股上有点痛苦。

Also, in particular to this case, I would say that removing redgreen is not the end of the world. Since it's specific to testing, you could also move the gem dependency into the environments/test.rb (or whatever other testing environments are set up) and not have to deal with it in development/staging/production.

此外,特别是在这种情况下,我会说删除redgreen不是世界末日。由于它特定于测试,您还可以将gem依赖项移动到environment / test.rb(或任何其他测试环境),而不必在开发/登台/生产中处理它。

Any gems that are dependent on testing should only be specified for your testing environments and not for your entire application.

任何依赖于测试的宝石都应该仅针对您的测试环境而不是整个应用程序进行指定。

#1


3  

Okay, found it, I was missing the test-unit gem.

好吧,发现它,我错过了测试单元宝石。

How I found it? I went to vendor/gems/redgreen-1.2.2/lib/redgreen.rb and looked at the "require" statements, which lists "test/unit". Quick googling led me to the test-unit gem, and after gem install test-unit it works now.

我怎么找到的?我去了vendor / gems / redgreen-1.2.2 / lib / redgreen.rb并查看了“require”语句,其中列出了“test / unit”。快速谷歌搜索引导我到测试单元宝石,并在宝石安装测试单元后,它现在工作。

I'm not sure if I can tell rake somehow that there is a dependency and I'm a bit disappointed that there was no better error message, but at least that's resolved now.

我不确定我是否能以某种方式告诉rake存在依赖关系而且我有点失望,因为没有更好的错误消息,但至少现在已经解决了。

#2


0  

Perhaps it's not telling you that it's looking for a different version of the gem for whatever reason. If you run (sudo) rake gems:install and try again, do you get the same message? The gem dependency business is a bit of a pain in the ass, to say the least.

也许它并没有告诉你,无论出于何种原因,它正在寻找不同版本的宝石。如果你运行(sudo)rake gems:安装并再试一次,你会得到相同的消息吗?至少可以说,宝石依赖企业在屁股上有点痛苦。

Also, in particular to this case, I would say that removing redgreen is not the end of the world. Since it's specific to testing, you could also move the gem dependency into the environments/test.rb (or whatever other testing environments are set up) and not have to deal with it in development/staging/production.

此外,特别是在这种情况下,我会说删除redgreen不是世界末日。由于它特定于测试,您还可以将gem依赖项移动到environment / test.rb(或任何其他测试环境),而不必在开发/登台/生产中处理它。

Any gems that are dependent on testing should only be specified for your testing environments and not for your entire application.

任何依赖于测试的宝石都应该仅针对您的测试环境而不是整个应用程序进行指定。