使用bundler从github安装RedCloth gem

时间:2011-08-08 13:41:20

标签: git gem ruby-on-rails-3.1 redcloth gemspecs

我遇到了RedCloth gem 4.2.7的最新版本发布的问题。具体来说,它是在this commit中解决的gcc 4.6编译问题,但是尽管它已经提交多久,但尚未包含在发行版中。

在我的Gemfile中,我改变了这个:

gem 'RedCloth', '4.2.7'

到此:

gem 'RedCloth', :git => 'git://github.com/jgarber/redcloth.git'

但是,当我运行bundle install时,我最终会收到一条警告消息:

RedCloth at /Users/mhuggins/.rvm/gems/ruby-1.9.2-p180@myapp/bundler/gems/redcloth-9d6d28f93b02 did not have a valid gemspec.
This prevents bundler from installing bins or native extensions, but that may not affect its functionality.
The validation message from Rubygems was:
  ["ext/redcloth_scan/redcloth_attributes.c", "ext/redcloth_scan/redcloth_inline.c", "ext/redcloth_scan/redcloth_scan.c"] are not files

看起来像redcloth.gemspec的this line试图包含源树中不存在的3个文件,这就是导致错误的原因。

任何人都知道这里发生了什么事吗?我一定是错过了一步或什么的。 (我在OS X上使用Rails 3.1 edge。)

2 个答案:

答案 0 :(得分:2)

尝试运行“bundle config build.RedCloth --with-cflags = -w”&然后“捆绑安装”。

答案 1 :(得分:0)

它有点繁琐,但我能够使用以下内容获得使用mac os x snow leopard的Gemfile的git版本...

在您的项目中:

bundle install

您收到如下错误消息:

RedCloth at /Users/kunzmann/.rvm/gems/ruby-1.9.2-p290/bundler/gems/redcloth-9d6d28f93b02 did not have a valid gemspec.

如果你有Ragel 6.3或更高版本(我使用brew install Ragel

那么你可以这样做
cd /Users/kunzmann/.rvm/gems/ruby-1.9.2-p290/bundler/gems/redcloth-9d6d28f93b02
bundle install
bundle exec rake compile

下次您在项目bundle install时,您应该看到:

Using RedCloth (4.2.7) from git://github.com/jgarber/redcloth.git (at master) with native extensions