简体   繁体   English

如何在 Mac 上安装 MIT Scheme?

[英]How to install MIT Scheme on Mac?

I want to install MIT Scheme on my Mac, I have downloaded the MacOS X binary(x86-64) .我想在我的 Mac 上安装MIT Scheme ,我已经下载了MacOS X binary(x86-64)

However, I could not make it work using Mac Terminal.但是,我无法使用 Mac Terminal 使其工作。

I have tried to follow these articles:我试图关注这些文章:

Installing MIT/GNU Scheme on Mac OS X Leopard 在 Mac OS X Leopard 上安装 MIT/GNU Scheme

Installing MIT Scheme on Mac OS X在 Mac OS X 上安装 MIT Scheme

but it seems out of date and does not work.但它似乎已经过时并且不起作用。

So, I'm looking for a simple method which allows me to write Scheme code using Mac Terminal.所以,我正在寻找一种简单的方法,它允许我使用 Mac 终端编写 Scheme 代码。

I have struggled for hours to try to install it.我已经挣扎了几个小时来尝试安装它。

UPDATED FOR EL CAPITAN :为 EL CAPITAN 更新

The best way that I've found was from here :我发现的最好方法是从这里开始

  1. Download either the 32-bit or 64-bit dmg file for Scheme.下载 Scheme 的32 位64 位dmg 文件。
  2. Double click the .dmg file, and you'll get this window, in which you should drag the "MIT/GNU Scheme" file into the Applications folder.双击 .dmg 文件,您将看到这个窗口,您应该在其中将“MIT/GNU Scheme”文件拖到 Applications 文件夹中。
  3. For the 32-bit version , run this command:对于 32 位版本,运行以下命令:

     sudo ln -s /Applications/MIT\\:GNU\\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-i386

    Then enter your administrator password, and run this command:然后输入您的管理员密码,并运行以下命令:

     sudo ln -s /usr/local/lib/mit-scheme-i386/mit-scheme /usr/local/bin/scheme

    For the 64-bit version , first run this command:对于 64 位版本,首先运行以下命令:

     sudo ln -s /Applications/MIT\\:GNU\\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-x86-64

    Then enter your administrator password and run this command:然后输入您的管理员密码并运行以下命令:

     sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/local/bin/scheme

And that's it!就是这样! Now you should be able to use MIT Scheme in your terminal by typing "scheme" into the command line:现在,您应该可以通过在命令行中输入“scheme”来在终端中使用 MIT Scheme:

Homebrew makes it easy for you. Homebrew 让您轻松完成。 On Terminal, type:在终端上,键入:

ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go) ; brew install mit-scheme

Done!完毕!

Edit编辑

The install script has been moved:安装脚本已被移动:

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

For Yosemite 10.10.3:对于优胜美地 10.10.3:

After installing X11.app and homebrew,安装 X11.app 和自制软件后,

 $ brew tap homebrew/x11 $ brew install mit-scheme

I found it easier when a maintained package manager such as homebrew covers all the dependency and build stuff.我发现当像 homebrew 这样维护的包管理器涵盖所有依赖和构建内容时,它会更容易。


Edit: simply编辑:简单

$ brew install mit-scheme

would do.会做。 X11 is now optional instead of dependence. X11 现在是可选的,而不是依赖。 There is still an --with-x11 option which requires whole Xcode.还有一个--with-x11选项需要整个 Xcode。

您可以使用以下命令使用自制软件安装方案

brew install mit-scheme

If you have the latest version of Mac system, El Capitan 10.11.2 , You might need to do something different than above.如果您有最新版本的 Mac 系统El Capitan 10.11.2 ,您可能需要做一些与上述不同的事情。

The first command will be same.第一个命令将是相同的。 For the 64-bit version , first run this command:对于 64 位版本,首先运行以下命令:

sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-x86-64

Then enter your administrator password and run this command:然后输入您的管理员密码并运行以下命令:

sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/local/bin/scheme

Note: The difference is you need to put local between /usr/ and /bin/注意:区别在于你需要在 /usr/ 和 /bin/ 之间放置local

Type scheme in the terminal to see if it works.在终端输入scheme,看看它是否有效。 If you get the following screenshot, that means you succeed it.如果您得到以下屏幕截图,则表示您成功了。

Success Result成功结果

You definitely need to put local there.你肯定需要把本地放在那里。 The reason is this, Apple improved OS security in OSX 10.10 (rootless), and changes to the general system-wide binaries (such as /usr/bin) is not permitted.原因是这样,Apple 在 OSX 10.10(无根)中改进了操作系统安全性,并且不允许更改一般系统范围的二进制文件(例如 /usr/bin)。

If you are having trouble with the accepted answer from @virgil-ming, try this:如果您对@virgil-ming 接受的答案有疑问,请尝试以下操作:

$ brew install Caskroom/cask/xquartz
$ brew install mit-scheme

Same idea, of course, but this got me up and running when brew tap homebrew/x11 responded with multiple conflicts.当然,同样的想法,但是当brew tap homebrew/x11响应多个冲突时,这让我开始运行。

As always, remember to brew update then try again when you are having problems, a la Homebrew's troubleshooting guide .与往常一样,记住brew update然后在遇到问题时再试一次,这是Homebrew 的故障排除指南

UPDATE FOR MAC OS HIGH SIERRA: MAC OS HIGH SIERRA 的更新:

Worked for me just by executing (if you are using Homebrew):只需执行即可为我工作(如果您使用的是 Homebrew):

brew install mit-scheme

If you are using docker, and I recommend you do:如果您使用 docker,我建议您执行以下操作:

docker run -it inikolaev/alpine-scheme

will drop you right into a scheme REPL.会让你直接进入 REPL 计划。

If you are using MacPorts, the command is similar to what others have posted for homebrew -如果您使用的是 MacPorts,则该命令类似于其他人为自制软件发布的命令 -

sudo port install mit-scheme

That set me up pretty well on OS X 10.8.5这让我在 OS X 10.8.5 上设置得很好

I came across a problem that the 10.x versions of the MIT/GNU Scheme do not support Mac OS X 10.11 El Capitan .我遇到了MIT/GNU Scheme10.x版本不支持Mac OS X 10.11 El Capitan 的问题 In fact, it requires Mac OS X 10.13 or higher .事实上,它需要Mac OS X 10.13 或更高版本

The topmost version supporting older Mac OS X versions is MIT/GNU Scheme 9.2 .支持旧版Mac OS X的最高版本是MIT/GNU Scheme 9.2

Unfortunately for users of the M1 chip , the official website for MIT-Scheme states in bold font that there is " No support for Apple silicon " :不幸的是,对于M1 芯片的用户, MIT-Scheme 的官方网站以粗体字表示不支持 Apple 芯片

At this time, we are unable to support new macs using Apple's silicon (the M1 chip).目前,我们无法支持使用 Apple 硅(M1 芯片)的新 Mac。 Although we support the ARM architecture it's based on, Apple's design uses W^X restrictions that conflict with the way that MIT/GNU Scheme manages memory.虽然我们支持它所基于的 ARM 架构,但 Apple 的设计使用 W^X 限制,这与 MIT/GNU Scheme 管理 memory 的方式相冲突。 Our native-code implementation requires both write and execute permissions on memory, and fixing that is a significant redesign that's unlikely to happen in the near future.我们的本机代码实现需要对 memory 的写入和执行权限,修复这个问题是一项重大的重新设计,在不久的将来不太可能发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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