【问题标题】:Can't bundle when deploying RoR app with passenger与乘客一起部署 RoR 应用程序时无法捆绑
【发布时间】:2012-03-24 04:27:49
【问题描述】:

我正在使用乘客和 apache 将应用程序部署到生产环境。我已经在同一台服务器上部署了多个应用程序,没有问题。但是,由于某种原因,我在使用此应用时遇到了问题。

当我运行 bundle 时,我收到了很多以前从未见过的警告:

WARNING:  #<ArgumentError: Illformed requirement ["#<YAML::Syck::DefaultKey:0x7fcbdc2ce610> 1.6.0"]>
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
  s.name = %q{bson_ext}
  s.version = "1.6.0"

  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
  s.authors = ["Mike Dirolf"]
  s.date = %q{2012-02-22}
  s.description = %q{C extensions to accelerate the Ruby BSON serialization. For more information about BSON, see http://bsonspec.org.  For information about MongoDB, see http://www.mongodb.org.}
  s.email = %q{mongodb-dev@googlegroups.com}
  s.extensions = ["ext/cbson/extconf.rb"]
  s.files = ["Rakefile", "bson_ext.gemspec", "ext/cbson/extconf.rb", "ext/cbson/bson_buffer.c", "ext/cbson/cbson.c", "ext/cbson/encoding_helpers.c", "ext/cbson/bson_buffer.h", "ext/cbson/encoding_helpers.h", "ext/cbson/version.h"]
  s.homepage = %q{http://www.mongodb.org}
  s.require_paths = ["ext"]
<SNIP>

<SNIP>
Using bson (1.6.0) 
Installing bson_ext (1.6.0) with native extensions 
Using bundler (1.0.22) 
Using coffee-script-source (1.2.0) 
Using execjs (1.3.0) 
Using coffee-script (2.2.0) 
Using rack-ssl (1.3.2) 
Using json (1.6.5) 
Using rdoc (3.12) 
Using thor (0.14.6) 
Using railties (3.2.2) 
Using coffee-rails (3.2.2) 
Using geoip_city (0.2.0) 
Using jquery-rails (2.0.1) 
Using libv8 (3.3.10.4) 
Installing mongo (1.6.0) 
Using mongoid (2.4.6) 
Using rails (3.2.2) 
Using sass (3.1.15) 
Using sass-rails (3.2.4) 
Using therubyracer (0.9.10) 
Using uglifier (1.2.3) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

虽然当我转到我的应用程序时,我的 gem 似乎被捆绑了,但我收到了一个乘客错误。

有人知道会发生什么吗?

提前致谢。

【问题讨论】:

  • 不同配置也有同样的问题。当我使用 BSON 1.6.0 版本推送 GemFile 时开始。

标签: ruby-on-rails-3 mongodb rubygems passenger bundler


【解决方案1】:

显然它是一个 bug 与 ruby​​ mongo 驱动程序 1.6.0 与旧 RubyGems 版本一起使用。它已经修复并将在 1.6.1 中(应该在几天前发布,我想现在任何一天都会发布)。

同时,修补您的GemFile(希望您没有那么多 1.6.0 樱桃...):

gem 'bson',  '< 1.6.0'
gem 'bson_ext', '< 1.6.0'
gem 'mongo',  '< 1.6.0'

HTH

【讨论】:

  • 我在使用 ruby​​ 2.0.0 的 bson_ext (1.9.1)、bson 1.9.1 和 mongo 1.9.1 中也出现此错误,但使用 ruby​​ 1.9.3 时没有错误。从谷歌其他页面的外观来看,似乎 rvm 安装可能是罪魁祸首。试试rvm get head &amp;&amp; rvm reinstall all
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-02
  • 1970-01-01
  • 2016-04-20
  • 2011-11-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多