在 Sublime 文本编辑器中构建 Ruby 时出错 [英] Error Building Ruby in Sublime Text Editor

查看:59
本文介绍了在 Sublime 文本编辑器中构建 Ruby 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

puts "Hello World!"

当我单击 CTRL+B (Tools->Build) 时,控制台中出现以下错误

When I click CTRL+B (Tools->Build) I get the following error in the console

[Errno 2] 没有那个文件或目录 [cmd:[u'~/.rvm/bin/rvm-auto-ruby',u'/home/ubuntu/rails_projects/Ruby/c2f.rb']] [目录:/home/ubuntu/rails_projects/Ruby] [路径:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games][已完成]

[Errno 2] No such file or directory [cmd: [u'~/.rvm/bin/rvm-auto-ruby', u'/home/ubuntu/rails_projects/Ruby/c2f.rb']] [dir: /home/ubuntu/rails_projects/Ruby] [path: /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games] [Finished]

下面是 Ruby.sublime-build

Below is the Ruby.sublime-build

{
    "cmd": ["~/.rvm/bin/rvm-auto-ruby", "$file"],
    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
    "selector": "source.ruby"
}

我在 Ubuntu 12.04、Sublime Text 2.0.1 中运行这个

I'm running this in Ubuntu 12.04, Sublime Text 2.0.1

~/.rvm/bin/rvm-auto-ruby -vruby 1.9.3p194 (2012-04-20 修订版 35410) [i686-linux]

~/.rvm/bin/rvm-auto-ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]

我错过了什么?我还设置了 Ruby 测试,并且正在运行.

What am I missing? I also have Ruby Test set up and that's working.

推荐答案

问题似乎出在 Ruby 命令路径中的 ~.可能不是很一般,但尽量改一下

The problem seems to be the ~ in your Ruby command path. It may not be very general, but try to change

"cmd": ["~/.rvm/bin/rvm-auto-ruby", "$file"]

"cmd": ["/home/your_username/.rvm/bin/rvm-auto-ruby", "$file"]

这篇关于在 Sublime 文本编辑器中构建 Ruby 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆