5

I have installed the latest version of mono from http://www.mono-project.com/download/ (v4.6.1.5 at time of writing) onto OSX Sierra (10.12)

In terminal I have run mono --version and get a result of -bash: mono: command not found.

which mono and which mcs both yield no results.

I have restarted after the installation and get the same result.

I have looked in the installation folder and I can see the framework has been installed:

  • /Library/Frameworks/Mono.framework/Versions/4.6.1
  • /Library/Frameworks/Mono.framework/Versions/Current (symlink to 4.6.1 folder)

This is a clean installation of OSX. I have only installed Chrome, Dropbox and Skype over the original OS.

Chris Hamons
  • 1,510
  • 11
  • 22
Mark Cooper
  • 6,738
  • 5
  • 54
  • 92
  • Possible duplicate of [Mono installed on Mac, but not recognized in terminal](http://stackoverflow.com/questions/32542535/mono-installed-on-mac-but-not-recognized-in-terminal) – SushiHangover Oct 13 '16 at 14:56
  • Thanks @SushiHangover - this was the case on my 1st post earlier this week, on another mac, but this is a Clean Installation. – Mark Cooper Oct 13 '16 at 15:10
  • Is there a `mono` in `/usr/local/bin`? Do you even have a `/usr/local/bin` directory? Is `/usr/local/bin` included in your path? – SushiHangover Oct 13 '16 at 15:13
  • I do have a `/usr/local` folder but nothing in there - no `/usr/local/bin` either – Mark Cooper Oct 13 '16 at 15:14
  • macOS clean install.... create the bin dir, symlink `mono` to there from `/Library/Frameworks/Mono.framework/Versions/Current`, and add that bin dir to your path.... – SushiHangover Oct 13 '16 at 15:16
  • Are you saying I should be reinstalling the operating system again? :-( – Mark Cooper Oct 13 '16 at 15:18
  • No.... just add the `bin` dir. – SushiHangover Oct 13 '16 at 15:18
  • "Recent" changes in OS-X/macOS no longer creates the /usr/local/bin by default. directory.... you can always add mono's `Current` dir to your path. But you will find out that a lot of other 3rd-party software require the local bin directory also.... – SushiHangover Oct 13 '16 at 15:21
  • OK then add a `mono` symlink from the `/usr/local/bin` folder into the `Current` symlink? – Mark Cooper Oct 13 '16 at 15:21
  • Yep, that would work. ;-) – SushiHangover Oct 13 '16 at 15:21
  • That didn't work. Added the symlink (alias) that points `/usr/local/bin/mono` to `/Library/Frameworks/Mono.framework/Versions/Current`. Restarted terminal, and rebooted. I still get nothing for `which mono` and an error for `mono --version`. – Mark Cooper Oct 13 '16 at 15:54
  • I seem to be having the same problem on my Macbook Air which I upgraded to Sierra – Sam Nov 24 '16 at 14:50
  • @Sam I ended up regressing back a previous version of Mono - that was OK for my needs. https://download.mono-project.com/archive/ – Mark Cooper Nov 24 '16 at 16:11
  • Thanks @MarkCooper exactly how old version did you have to go back to? – Sam Nov 25 '16 at 01:30
  • @Sam - I've posted the details of my findings in an answer below. I'd be interested to know if you find the same. – Mark Cooper Nov 25 '16 at 08:22

2 Answers2

2

Just add /Library/Frameworks/Mono.framework/Commands at the end of your PATH, no need then to set up any symlinks. Of course this should be done automatically for you during installation...

volkerk
  • 134
  • 1
  • 7
1

I raised a bug with Xamarin regarding this: https://bugzilla.xamarin.com/show_bug.cgi?id=45574. As of time of writing there has been no response to this ticket.

In summary:
I have had to revert back to a previous release.
v4.4.2 didn't work either so I went back to v4.3.2
(from https://download.mono-project.com/archive/).


I don't know if this bug is view-able publicly, so the details are as follows;

I am installing Mono v4.6.1.3 on a clean (brand-new) instance of OSX Sierra (Virtual Machine). There is no other software installed other than that included the OSX Sierra. I have not run any security updates.

Prior to installation:
- I have enabled viewing of hidden files
- I have downloaded the 4.6.1.3 installer from http://www.mono-project.com/download/
- The folder /usr/local/bin exists (See [1] on attachement)

I have successfully run the installation package choosing all the default options (See [2] on attachment)

No files or links have been created in the /usr/local/bin folder

From the command line;
- mono --version throws an error: -bash: mono: command not found
- which mono returns nothing (see [3] on attachment)

I have to change folders to get this working:
- cd /Library/Frameworks/Mono.framework/Versions/Current/Commands
- ./mono --version returns: "Mono JIT compiler version 4.6.1 (mono-4.6.0-branch-c8sr0/abb06f1 Fri Sep 23 19:24:23 EDT 2016)"


This is different behaviour to previous versions, for example;

Restored VM to "clean" state
- Installed v4.2.4 Mono package (downloaded from http://download.mono-project.com/archive/)
- The /usr/local/bin folder is populated with links during installation

Once the 4.2.4 installer has completed I can successfully run the following without changing folders (i.e. from /Users/Username); - mono --version from terminal returns: "Mono JIT compiler version 4.2.4 (explicit/71b88f3 Thu May 5 17:25:51 EDT 2016) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com"
- which mono returns "/usr/local/bin/mono"

Mark Cooper
  • 6,738
  • 5
  • 54
  • 92