博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Using MIT-Scheme in MacOS X on the Command Line
阅读量:4069 次
发布时间:2019-05-25

本文共 2987 字,大约阅读时间需要 9 分钟。

Introduction

 is great, but if you’re an OSX user, and have a comfortable terminal environment set up, you might prefer to use mit-scheme directly from the command line instead of as a separate OSX application. Since it always takes me a minute to remember the steps, I figured I’d write it up.

My goal is to be able to run the interactive mit-schemeshell directly from the command line in OSX.

Necessary Steps

Download

, either i386 or x86-64 depending on your machine. Mount the .dmg, and drag the “MIT/GNU Scheme” icon into the “Applications” folder.

This is the standard install. From here, you can run MIT/GNU Scheme as if it were any other application, but we don’t want that.

Next, symlink the binary to scheme in your /usr/bin:

$ sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources/mit-scheme /usr/bin/scheme

Export

NOTE: Depending on how you’ve already configured Bash, you’ll want to set this variable in one of three places:

  1. ~/.bash_profile
  2. ~/.bash_login
  3. ~/.profile

On load, Bash tries to find your local profiles in that order. If it finds a file, it won’t load any following profiles. Therefore, you’re going to want to check to see which, if any, of these files already exist, and append to that file. For me, this was~/.profile.

Add the library path to your profile:

$ echo "export MITSCHEME_LIBRARY_PATH=\"/Applications/MIT\:GNU\ Scheme.app/Contents/Resources\"" >> ~/.profile

To make it easier for other applications to find the Scheme executable, you can also add the following environmental variable as well:

$ echo "export MIT_SCHEME_EXE=\"/usr/local/scheme\"" >> ~/.profile

Reload

Restart your terminal somehow, or simply reload your bash profile:

$ source ~/.profile

Finished

You should now be able to run the MIT/GNU Scheme shell directly from the command line:

$ schemeMIT/GNU Scheme running under MacOSXType `^C' (control-C) followed by `H' to obtain information aboutinterrupts.Copyright (C) 2011 Massachusetts Institute of Technology This is freesoftware; see the source for copying conditions. There is NO warranty; noteven for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Image saved on Tuesday November 8, 2011 at 10:45:46 PM  Release 9.1.1 || Microcode 15.3 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 4.118  Edwin 3.1161 ]=>

And that’s it!

Troubleshooting

“Can’t Find A Readable Default”

If you’re getting the following error:

$ schemescheme: can't find a readable default for option --band.        searched for file all.com in these directories:        /usr/local/lib/mit-scheme-x86-64Inconsistency detected.

Chances are that you skipped over my note in the “Export” section above. Running scheme probably ran great for you the first time, but now that some time has passed and you’ve reloaded your terminal, it doesn’t work!

The problem likely is that the environmental variable linking to scheme’s library is not being loaded because you have multiple Bash profile files. Consolidate your profiles and you should be good to go.

转载地址:http://asoji.baihongyu.com/

你可能感兴趣的文章
线程并发时,防止单例出现多个实例。
查看>>
简单实现防止sql注入的方法
查看>>
事务的隔离级别及mysql中相关的设置
查看>>
windows 中 Dos命令行中设置字符为UTF-8
查看>>
JsonUtils工具类 把java对象转成Json串的工具类
查看>>
JAVA调用linux中的shell命令行的工具类
查看>>
MD5 工具类 支持文件 字符串加密
查看>>
PathUtil java中获取路径的工具类,如WebClassesPath、WebInfPath、WebRoot
查看>>
Maven中,添加不上oracle 的JDBC的解决办法
查看>>
业务中台的困境、及可能的解
查看>>
读Martin Fowler's 《Patterns of Enterprise Application Architecture》有感
查看>>
ceph (luminous 版) crushmap 与 pool结合用于物理划分 IO 使用域
查看>>
mysql 相关索引
查看>>
tomcat7 - cacti 备忘
查看>>
kubernetes 上部署 kubevirt 运行虚拟机
查看>>
kubevirt 对 VMI 调用 CEPH 作为云盘方法
查看>>
通过 noVNC 访问 kubevirt中的 vmi
查看>>
megacli 缓存策略
查看>>
golang go-callvis
查看>>
innodb 引擎数据恢复
查看>>