# Detecting Mono path

**URL:** <https://www.ruby-forum.com/t/detecting-mono-path/118574>\
**Category:** IronRuby\
**Created:** [October 29, 2007, 3:44am UTC](https://www.ruby-forum.com/t/detecting-mono-path/118574 "2007-10-29T03:44:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanghyeon\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e56c9b/32.png) [@Sanghyeon\_S](https://www.ruby-forum.com/u/Sanghyeon_S)\
**Post date:** [October 29, 2007, 3:44am UTC](https://www.ruby-forum.com/t/detecting-mono-path/118574/1 "2007-10-29T03:44:38Z")

</div>

The official way to detect path to Mono runtime is to run pkg-config.  
The following patch should resolve TODO.

# Index: Rakefile

— Rakefile (revision 53)  
+++ Rakefile (working copy)  
@@ -32,7 +32,8 @@  
if ENV[‘mono’].nil?  
FRAMEWORK\_DIR = Pathname.new(ENV[‘windir’].dup) + ‘[Microsoft.NET](http://Microsoft.NET)’ +  
‘Framework’ + ‘v2.0.50727’  
else

- FRAMEWORK\_DIR = Pathname.new(‘/usr/local/lib/mono/2.0’) # TODO:  
get mono path from ENV

- libdir = IO.popen(‘pkg-config --variable=libdir mono’).read.strip
- FRAMEWORK\_DIR = Pathname.new(libdir) + ‘mono’ + ‘2.0’  
end

CS\_COMPILER = ENV[‘mono’].nil? ? ‘csc’ : ‘gmcs’
