总ruby新手,试图在Mac OS X Snow leopard上安装Rails/MongoDB应用程序。乘客:“缺少这些所需的宝石红绿色”
安装的Ruby 1.9.1和RubyGems 1.3.7,which ruby
和which gem
指向同一个目录。我使用的是内置apache和Passenger 2.2.11的Snow Leopard。我正在使用mongo-site的导轨模板,这似乎总体上工作正常。
确切的错误乘客给予我的是:
/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 Run
耙宝石:安装to install the missing gems.
奇怪的是,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
在environment.rb中注释掉这条线“解决”了这个问题,但这并不是我想要的:
config.gem 'redgreen'
我不明白宝石的任何东西,但从我有限的理解,红绿应该在那里找到?
是否有一个原因明确地从您的环境调用redgreen?大多数使用redgreen的gem都会自己调用它,而不需要你明确地做它。我知道这并不真正回答你的问题,更多的是好奇心:) – theIV 2010-05-19 06:21:35
@theIV不知道,我只是“盲目地”跟随提供的模板,希望这些人知道他们在做什么。我正在学习这些东西,并试图让一个网站开始运行,开始写我的第一个红宝石应用程序:) – 2010-05-19 06:24:06