简体   繁体   中英

I want to install Mono on MacOSX Yosemite

I want to install Mono on MacOSX Yosemite.

I installed it but I tried type "mono", terminal said "command not found". So it looks like it failed to install it properly?

How to install Mono properly on MacOSX Yosemite?

The easiest way to install software on OS X is to use a package manager like Homebrew . To install Homebrew open a Terminal and paste in the following command

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Then to install Mono you can simply use

brew install mono

which will install version 4.2.0.179.

Newer versions of mono comply to the "El Capitan" requirements of not installing anything into /usr/bin and thus now /usr/local/bin is used. I am not sure which mono 4.x release that started in...

But I would assume that you do not have /usr/local/bin in your path(?), try:

export PATH=/usr/local/bin:${PATH}
which mono
which mcs

In my case, I have 4.2.0 installed:

$ which mono
/usr/local/bin/mono
$ which mcs
/usr/local/bin/mcs
$ mono --version
Mono JIT compiler version 4.2.0 (explicit/2701b19 Mon Aug 31 09:57:28 EDT 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
$ cat `which mcs`
#!/bin/sh
export PATH=$PATH:/Library/Frameworks/Mono.framework/Versions/4.2.0/bin
export PKG_CONFIG_PATH=/Library/Frameworks/Mono.framework/External/pkgconfig:/Library/Frameworks/Mono.framework/Versions/4.2.0/lib/pkgconfig:/Library/Frameworks/Mono.framework/Versions/4.2.0/share/pkgconfig:$PKG_CONFIG_PATH
exec /Library/Frameworks/Mono.framework/Versions/4.2.0/bin/mono $MONO_OPTIONS /Library/Frameworks/Mono.framework/Versions/4.2.0/lib/mono/4.5/mcs.exe "$@"

Homebrew is certainly an option.

Another way is to download the Mono .pkg file , run the .pkg and accept the license to install Mono on the Mac. The stable Mono versions are provided on the Mono website

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM