0

我在使用 RedCloth gem 的最新版本 4.2.7 时遇到问题。具体来说,这是在此提交中解决的 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 的这一行试图包含 3 个在源代码树中不存在的文件,这就是导致错误的原因。

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

4

2 回答 2

2

尝试运行“bundle config build.RedCloth --with-cflags=-w”,然后运行“bundle install”。

于 2012-05-08T04:59:56.430 回答
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
于 2011-08-09T01:58:23.380 回答