diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE ScopedTypeVariables #-}
 import Distribution.Simple
 import Distribution.Verbosity
 import Distribution.Simple.Configure
@@ -10,10 +11,13 @@
 import System.Exit
 
 import Control.Applicative
+import Control.Exception
 
 import Data.List (partition,stripPrefix,foldl')
 import Data.Maybe (mapMaybe)
 
+-- --rubyversion=20 --rubylib=ruby-2.0 --rubyinc=/usr/include/ruby-2.0.0 --rubyinc=/usr/include/x86_64-linux-gnu/ruby-2.0.0
+-- {rbVersion = (2,0,0), rbInstallName = "ruby2.0", rbIncludes = ["/usr/include/ruby-2.0.0","/usr/include/ruby-2.0.0/x86_64-linux-gnu"], rbLib = "/usr/lib", rbLibName = "ruby-2.0"}
 
 type RubyVersion = (Int, Int, Int)
 data RubyInfo = RubyInfo { rbVersion     :: RubyVersion
@@ -26,7 +30,9 @@
 evalRuby :: String            -- expression to evaluate
          -> IO (Maybe String) -- stdout, if successfull
 evalRuby exp = do
-    (exitCode, out, err) <- readProcessWithExitCode "ruby" ["-e", exp] ""
+    let getruby [] = return (ExitFailure 3, "beuh", undefined)
+        getruby (x:xs) = readProcessWithExitCode x ["-e", exp] "" `catch` \ (_ :: IOException) -> getruby xs
+    (exitCode, out, err) <- getruby [ "ruby2.1", "ruby2.0", "ruby2", "ruby1.8", "ruby"]
     return $ if exitCode == ExitSuccess
                then Just out
                else Nothing
@@ -49,12 +55,14 @@
         Just v -> do
             installName <- evalRuby "print RbConfig::CONFIG['RUBY_INSTALL_NAME']"
             headerDir   <- evalRuby "print RbConfig::CONFIG['rubyhdrdir']"
-            archDir     <- evalRuby "print RbConfig::CONFIG['rubyhdrdir'] + File::Separator + RbConfig::CONFIG['arch']"
+            headerDir'  <- evalRuby "print RbConfig::CONFIG['rubyhdrdir'] + File::Separator + 'ruby'"
+            archDir     <- evalRuby "print RbConfig::CONFIG['rubyarchhdrdir']"
             libDir      <- evalRuby "print RbConfig::CONFIG['libdir']"
+            td          <- evalRuby "print RbConfig::CONFIG['topdir']"
             libName     <- evalRuby "print RbConfig::CONFIG['LIBRUBY_SO'].sub(/^lib/,'').sub(/\\.(so|dll|dylib)([.0-9]+)?$/,'')"
             return $ RubyInfo <$> pure v
                               <*> installName
-                              <*> sequence [headerDir, archDir]
+                              <*> sequence [headerDir, headerDir', archDir, td]
                               <*> libDir
                               <*> libName
 
diff --git a/hruby.cabal b/hruby.cabal
--- a/hruby.cabal
+++ b/hruby.cabal
@@ -2,7 +2,7 @@
 --  see http://haskell.org/cabal/users-guide/
 
 name:                hruby
-version:             0.3.1.5
+version:             0.3.1.6
 synopsis:            Embed a Ruby intepreter in your Haskell program !
 description:         This doesn't work with Ruby 1.9. Everything you need should be in Foreign.Ruby.Safe.
 license:             BSD3
@@ -37,7 +37,7 @@
   c-sources:            cbits/shim.c
   install-includes:     cbits/shim.h
   include-dirs:         cbits
-  Includes:             "ruby.h"
+  Includes:             ruby.h
   extra-libraries:      ruby
 
 Test-Suite test-roundtrip
