我想让Supreme Linter插件(https://github.com/Kronuz/SublimeLinter)识别Ruby 1.9语法.有人能在SublimateText 2中实现这个功能吗?

以下是我当前的默认设置文件:

/*
    SublimeLinter default settings
*/
{
    /*
        Sets the mode in which SublimeLinter runs:

        true - Linting occurs in the background as you type (the default).
        false - Linting only occurs when you initiate it.
        "load-save" - Linting occurs only when a file is loaded and saved.
    */
    "sublimelinter": true,

    /*
        Maps linters to executables for non-built in linters. If the executable
        is not in the default system path, or on posix systems in /usr/local/bin
        or ~/bin, then you must specify the full path to the executable.
        Linter names should be lowercase.

        This is the effective default map; your mappings may override these.

        "sublimelinter_executable_map":
        {
            "perl": "perl",
            "php": "php",
            "ruby": "ruby"
        },
    */
    "sublimelinter_executable_map":
    {
    },

    /*
        Maps syntax names to linters. This allows variations on a syntax
        (for example "Python (Django)") to be linted. The key is
        the base filename of the .tmLanguage syntax files, and the value
        is the linter name (lowercase) the syntax maps to.
    */
    "sublimelinter_syntax_map":
    {
        "Python Django": "python"
    },

    // An array of linter names to disable. Names should be lowercase.
    "sublimelinter_disable":
    [
    ],

    /*
        The minimum delay in seconds (fractional seconds are okay) before
        a linter is run when the "sublimelinter" setting is true. This allows
        you to have background linting active, but defer the actual linting
        until you are idle. When this value is greater than the built in linting delay,
        errors are erased when the file is modified, since the assumption is
        you don't want to see errors while you type.
    */
    "sublimelinter_delay": 0,

    // If true, lines with errors or warnings will be filled in with the outline color.
    "sublimelinter_fill_outlines": false,

    // If true, lines with errors or warnings will have a gutter mark.
    "sublimelinter_gutter_marks": false,

    // If true, the find next/previous error commands will wrap.
    "sublimelinter_wrap_find": true,

    // If true, when the file is saved any errors will appear in a popup list
    "sublimelinter_popup_errors_on_save": false,

    // jshint: options for linting JavaScript. See http://jshint.com/#docs for more info.
    // By deault, eval is allowed.
    "jshint_options":
    {
        "evil": true,
        "regexdash": true,
        "browser": true,
        "wsh": true,
        "trailing": true,
        "sub": true,
        "strict": false
    },

    // A list of pep8 error numbers to ignore. By default "line too long" errors are ignored.
    // The list of error codes is in this file: https://github.com/jcrocholl/pep8/blob/master/pep8.py.
    // Search for "Ennn:", where nnn is a 3-digit number.
    "pep8_ignore":
    [
        "E501"
    ],

    /*
        If you use SublimeLinter for pyflakes checks, you can ignore some of the "undefined name xxx"
        errors (comes in handy if you work with post-processors, globals/builtins available only at runtime, etc.).
        You can control what names will be ignored with the user setting "pyflakes_ignore".

        Example:

        "pyflakes_ignore":
            [
                "some_custom_builtin_o_mine",
                "A_GLOBAL_CONSTANT"
            ],
    */
    "pyflakes_ignore":
    [
    ],

    /*
        Ordinarily pyflakes will issue a warning when 'from foo import *' is used,
        but it is ignored since the warning is not that helpful. If you want to see this warning,
        set this option to false.
    */
    "pyflakes_ignore_import_*": true,

    // Objective-J: if true, non-ascii characters are flagged as an error.
    "sublimelinter_objj_check_ascii": false
}

推荐答案

我能够使用ruby 1.9可执行文件的绝对路径让它工作.我使用的是rbenv,所以要获得我运行rbenv which ruby的路径,可能需要输入/usr/local/bin/ruby/usr/local/bin/ruby19.

这就是我的SublimiteLiner默认设置的样子(如果愿意,也可以将其放入特定于项目的文件中:)

Preferences -> Package Settings -> SublimeLinter -> Settings - User

"sublimelinter_executable_map":
{
    "ruby": "~/.rbenv/versions/1.9.3-p0/bin/ruby"
},

Ruby相关问答推荐

每次调用返回新的 REST 响应的 Ruby Rspec class_double

从整数中 Select 重复数字的字符串

Ruby:一个方法可以返回不同类型的对象吗?

如何在 rspec 中使用 `eq` 匹配器和 `hash_include` 匹配器来获取哈希数组

如何使用 Ruby 的 optparse 解析没有名称的参数

`Range#include?` 和 `Range#cover?` 有什么区别?

给url添加参数

Ruby 中的 :+ 和 &:+ 是什么?

Vim 用 ruby​​ 语法高亮显示很慢

Ruby - 查看端口是否打开

为什么整数除法在许多脚本语言中舍入?

在 RSpec 测试期间 suppress 控制台输出

Ruby注入初始为哈希

如何强制 Ruby 字符串为 n 个字符

在本地覆盖 Vagrant 配置设置(每个开发人员)

如何使用密码保护我的 /sidekiq 路由(即需要对 Sidekiq::Web 工具进行身份验证)?

gem 安装失败并出现 openssl 失败

Ruby中的urldecode?

=== 与 == 在 Ruby 中

在 Ruby 中解析制表符分隔文件的最佳方法是什么?