Matt Huggins
Matt Huggins

Reputation: 83329

Installing RedCloth gem from github with bundler

I'm running into a problem with the latest versioned release of the RedCloth gem, 4.2.7. Specifically, it's the gcc 4.6 compile issue that was resolved in this commit, but has not yet been included in a release despite how long ago it was committed.

In my Gemfile, I changed this:

gem 'RedCloth', '4.2.7'

to this:

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

However, when I run bundle install, I end up getting a warning message that reads:

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

It looks like this line of the redcloth.gemspec is attempting to include 3 files that don't exist in the source tree, which is what's causing the error.

Anyone know what's going on here for me? I must be missing a step or something. (I'm on OS X using Rails 3.1 edge.)

Upvotes: 0

Views: 1142

Answers (2)

David
David

Reputation: 1143

Try running "bundle config build.RedCloth --with-cflags=-w" & then "bundle install".

Upvotes: 2

Joshua Kunzmann
Joshua Kunzmann

Reputation: 930

It's a bit fiddly, but I was able to get the git version of the Gemfile working on mac os x snow leopard with the following...

In your project:

bundle install

You get the error message like:

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

Then you can do this if you have Ragel 6.3 or greater (I used brew install Ragel)

cd /Users/kunzmann/.rvm/gems/ruby-1.9.2-p290/bundler/gems/redcloth-9d6d28f93b02
bundle install
bundle exec rake compile

The next time you bundle install in your project you should see:

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

Upvotes: 0

Related Questions