ruby-on-rails - 设置 'EDITOR' 或 'BUNDLER_EDITOR' 环境变量

标签 ruby-on-rails ruby command-line environment-variables bundler

我试图在 Sublime Text 中打开一个 gem,但没有成功。我安装了 bundler 。这是正在发生的事情。

在命令行中:

$bundle open Devise
To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR

当我去 Bundler website它说,

Open the source directory of the given bundled gem:

$ bundle open GEM

This opens the source directory of the provided GEM in your editor. For this to work the EDITOR or BUNDLER_EDITOR environment variable has to be set.

我对这一切都是陌生的。设置我的 EDITORBUNDLER_EDITOR 环境变量的具体步骤是什么?我在 Mac 上使用 Sublime Text。

谢谢。

最佳答案

假设您使用的是 bash shell,您需要使用以下命令编辑 ~/.bashrc~/.bash_profile:

export EDITOR=<editor name>

示例,专门用于 Sublime:

export EDITOR='subl -w'

参见:Sublime OS X Command Line docs

关于ruby-on-rails - 设置 'EDITOR' 或 'BUNDLER_EDITOR' 环境变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25084035/

相关文章:

ruby-on-rails - 如何使用 ruby​​ Base64 解码 utf8 字符

ruby-on-rails - 在 Rails 3 中使用 Cucumber/Capybara 测试 jQuery 标记自动完成

css - SASS 上的引用图像

带条件的单行 Ruby 多个语句

ruby-on-rails - Rails 3.1 与 PostgreSQL : GROUP BY must be used in an aggregate function

java - 使用 jar 和文本文件输入运行 java 文件

if-statement - 如何在 if 语句中使用命令行中的参数?

ruby-on-rails - 如何使用 ActionMailer 发送 html 电子邮件?

bash - 如何将 “escape hell”传递给docker run

ruby - 使用 bundle 程序验证最低版本要求