The C Extension The RubyGems Handbook provides an overview of the build process.
The critical lines in your extconf.rb are near the ends:
require "mkmf"
This will create a Makefile for you. Makefile is created using the configuration values stored in the RbConfig::CONFIG[] array; RbConfig::CONFIG['DLEXT'] configuration value of interest to you:
$ ruby -e "require 'rbconfig'; puts RbConfig::CONFIG['DLEXT'];" so
To easily see the entire configuration, find the rbconfig.rb file; mine is in /usr/lib/ruby/1.8/x86_64-linux/rbconfig.rb and I will include the first few lines:
# This file was created by mkconfig.rb when ruby was built. Any # changes made to this file will be lost the next time ruby is built. module Config RUBY_VERSION == "1.8.7" or raise "ruby lib version (1.8.7) doesn't match executable version (#{RUBY_VERSION})" TOPDIR = File.dirname(__FILE__).chomp!("/lib/ruby/1.8/x86_64-linux") DESTDIR = '' unless defined? DESTDIR CONFIG = {} CONFIG["DESTDIR"] = DESTDIR CONFIG["INSTALL"] = '/usr/bin/install -c' CONFIG["EXEEXT"] = "" CONFIG["prefix"] = (TOPDIR || DESTDIR + "/usr") ... CONFIG["DLEXT"] = "so" CONFIG["LDSHARED"] = "$(CC) -shared" CONFIG["CCDLFLAGS"] = " -fPIC" ...
So, some version of your rbconfig.rb file was created when another version of Ruby was built, which suggested that dynamically linked extensions should have a different extension. This may be a feature of rvm (which I still need to learn more about), or it may be the difference between the supplied Apple Ruby and the self-compiled Ruby. You can see in the comment header of the file that you can easily make changes to rbconfig.rb yourself, but it will be deleted the next time you restore or install another Ruby built.
(By the way, I thought the extension was .dylib , but some time passed since I used OS X too).
source share