简体   繁体   English

获取infy ruby​​以使用ruby版本管理器(rvm)

[英]Get inf-ruby to use ruby version manager (rvm)

I have the ruby version manager installed and use the ruby implementation installed by RVM set to the default so that 'which ruby' shows '~/.rvm/ruby-1.8.6-p383/bin/ruby' yet when I open an inf-ruby buffer in emacs, it uses the ruby installed in /usr/bin. 我安装了ruby版本管理器并使用RVM安装的ruby实现设置为默认值,以便当我打开inf时'which ruby​​'显示'〜/ .rvm / ruby​​-1.8.6-p383 / bin / ruby​​' emacs中的-ruby缓冲区,它使用/ usr / bin中安装的ruby。

Is there a way to get emacs to respect the path for ruby the same way the shell does? 有没有办法让emacs像shell一样尊重ruby的路径?

Thanks! 谢谢!

I created a emacs extension to integrate rvm into emacs. 我创建了一个emacs扩展来将rvm集成到emacs中。 If you are interested you can get it here: http://github.com/senny/rvm.el 如果您有兴趣,可以在这里获取: http//github.com/senny/rvm.el

I know this is an old question, but it might help someone else with the same type of problem in the future. 我知道这是一个老问题,但它可能会帮助其他人在将来遇到同样类型的问题。

I have installed Ruby/Rails via rvm, set the default Ruby version I want to use. 我已经通过rvm安装了Ruby / Rails,设置了我想要使用的默认Ruby版本。

I then installed rvm via emacs ELPA package manager. 然后我通过emacs ELPA包管理器安装了rvm。

I added the following to my ~/.emacs: 我在〜/ .emacs中添加了以下内容:

(require 'rvm)  
(rvm-use-default)

I can now run emacs and open eshell/shell and everything is working as expected. 我现在可以运行emacs并打开eshell / shell,一切都按预期工作。

尝试自定义exec-path :Mx customize-option RET exec-path RET

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

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