更新:尝试十一月CTP版本。 相同的错误讯息。 忘了提及这个服务器已经安装了Ubuntu服务器版本。 我在运行Desktop 10.10的Ubuntu桌面上没有这个问题。 所以我怀疑这可能是一些命令行相关的库缺失。 在我安装了libreadline-dev和libreadline5之后,错误信息消失了。 但是,fsi卡住的问题依然存在。
Update2:尝试新的单声道2.8.1。 同样的FSI卡住的问题。
更新3:由于这个问题是非常可重复的,我把它报告为微软的fsi.exe中的一个错误。 让我们看看它是如何去的。
Update4:得到了Don Syme的快速回应。 他build议的解决scheme解决了这个问题。 我自己创造了答案。
嗨,
我在运行Ubuntu 10.10和Mono 2.8的服务器上安装了F#2.0。 fsc.exe运行完美,我在编译fs文件没有问题。 但是,当我运行fsi.exe如下:mono /usr/local/FSharp/bin/fsi.exe
我得到了FSI提示,但错误消息不断重复
“无法安装Ctrl-C处理程序 – Ctrl-C处理将不可用错误是:exception已被调用的目标引发”
我在这里错过了什么?
Mono 2.8是从源代码编译安装的。
真的很尴尬回答我自己的问题。 无论如何,我会回答,让其他人可以受益。
首先,安装libreadline-dev和libreadline5,这样可以摆脱下面的错误信息
无法安装Ctrl-C处理程序 – Ctrl-C处理将不可用。 错误是:异常已被调用的目标引发
如果遇到fsi.exe卡住的问题,请尝试
fsi --gui-
这对我来说是完美的。
这是我的理解为什么发生这样的问题。 如果你看一下代码,你会发现fsi.exe实际上引用了System.Windows.Forms,它进一步链接到Window系统。 在我的情况下,我在没有安装X系统的服务器上运行fsi。 因此,fsi在那里试图与不存在的X交谈。这就解释了为什么我在桌面上没有这个问题。
在Linux下F#从来没有为我工作过。 今天,Mono 2.8和2010年11月份的F#版本(这个版本和前一个版本的版本号完全一样?)我得到:
$ sudo ./install-mono.sh In order to add FSharp.Core.dll to the Mono GAC the DLL needs to be re-signed with the mono.snk key. The mono.snk key is available from the 'Mono Sources'. http://www.mono-project.com/ http://github.com/mono/mono/raw/master/mcs/class/mono.snk For example, run: wget -O mono.snk http://github.com/mono/mono/raw/master/mcs/class/mono.snk Then re-run this script. An alternative to installing the DLLs in the Mono GAC is to add the FSharp bin directory to the MONO_PATH variable. For more information on 'How Mono Finds Assemblies' see http://www.mono-project.com/Gacutil
如果我运行它建议的wget
命令,那么它会死亡:
$ wget -O mono.snk http://github.com/mono/mono/raw/master/mcs/class/mono.snk --2010-11-23 17:02:43-- http://github.com/mono/mono/raw/master/mcs/class/mono.snk Resolving github.com... 207.97.227.239 Connecting to github.com|207.97.227.239|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://github.com/mono/mono/raw/master/mcs/class/mono.snk [following] --2010-11-23 17:02:44-- https://github.com/mono/mono/raw/master/mcs/class/mono.snk Connecting to github.com|207.97.227.239|:443... connected. ERROR: certificate common name `*.github.com' doesn't match requested host name `github.com'. To connect to github.com insecurely, use `--no-check-certificate'. Unable to establish SSL connection.
现在,如果我重新运行F#安装程序,我得到一个不同的错误:
$ sudo ./install-mono.sh -- Resigning FSharp.Core.dll with mono.snk ERROR: Invalid number of parameters. Usage: sn [-q | -quiet] options [parameters] -q | -quiet Quiet mode (minimal display) Help options -? | -h Show this help screen about the tool -? | -h config Configuration options -? | -h csp Crypto Service Provider (CSP) related options -? | -h convert Format convertion options -? | -h sn StrongName signing options -- Installing FSharp DLLS into the GAC Failure adding assembly bin/FSharp.Core.dll to the cache: Strong name cannot be verified for delay-signed assembly
如果我mono.snk
将Mono 2.8目录中的mono.snk
文件复制到F#目录,那么安装程序似乎工作:
$ sudo ./install-mono.sh -- Resigning FSharp.Core.dll with mono.snk Assembly bin/FSharp.Core.dll signed. -- Installing FSharp DLLS into the GAC Installed bin/FSharp.Core.dll into the gac (/usr/local/lib/mono/gac)
但是F#本身仍然不能像以前那样工作(输入输入时出现挂起):
$ mono bin/fsi.exe Microsoft (R) F# 2.0 Interactive build 2.0.0.0 Copyright (c) Microsoft Corporation. All Rights Reserved. For help type #help;; > 1+2*3;;
我必须使用CTRL + Z重新获得控制权,然后kill %1
来杀死流氓程序。