Can't install gems with native extensions

➤ gem install rdiscount
Building native extensions. This could take a while…
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
WARNING: JRuby does not support native extensions or the mkmf' library. Check wiki.jruby.org for alternatives. extconf.rb:3: undefined methoddir_config’ for main:Object
(NoMethodError)

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/rdiscount-1.6.3 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/rdiscount-1.6.3/ext/gem_make.out

I’ve the same problem with RedCloth.
I don’t even use jruby.

➤ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0]

On Thu, Mar 11, 2010 at 1:50 PM, Nikita V. [email protected] wrote:

➤ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0]

Is it possible you have Jruby installed anyway? It sounds like Jruby’s
version of gem is running. Try which gem or gem env to find out.
If it is Jruby’s gem, try putting MRI ahead of it in your $PATH.

Eric C. wrote:

Is it possible you have Jruby installed anyway?

Yes.

➤ which jruby
/usr/local/bin/jruby

I just removed it, but it doesn’t help

➤ rm -rf /usr/local/bin/jruby
➤ jruby
-bash: jruby: command not found
➤ gem install rdiscount
… same error …

Try which gem or gem env to find out.

➤ which gem
/usr/local/bin/gem
➤ gem env
RubyGems Environment:

Can’t see problem here.

I’ve jruby installed via Homebrew. I’ve removed it and re-install ruby.
Now all works fine.

On Mar 15, 10:51 am, Nikita V. [email protected] wrote:

I’ve jruby installed via Homebrew. I’ve removed it and re-install ruby.
Now all works fine.

Posted viahttp://www.ruby-forum.com/.

I’m getting this same error, but I would like to find a fix if anyone
has any ideas.