设置“编辑器”或“BUNDLER_EDITOR”环境变量

时间:2023-01-21 17:50:19

I am trying to open up a gem in Sublime Text, unsuccessfully. I have Bundler installed. Here is what is happening.

我正试图用一种崇高的文字来打开一颗宝石,但没有成功。我安装了打包机。这就是正在发生的事情。

In the command line:

在命令行:

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

When I go to the Bundler website it says,

当我在Bundler网站上看到,

Open the source directory of the given bundled gem:

打开给定的绑定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.

这将在编辑器中打开提供的GEM的源目录。为此,必须设置编辑器或BUNDLER_EDITOR环境变量。

I am new to all of this. What are the specific steps to set my EDITOR or BUNDLER_EDITOR environment variables? I'm on a Mac, using Sublime Text.

我对这一切都是陌生的。设置编辑器或BUNDLER_EDITOR环境变量的具体步骤是什么?我用的是Mac,用的是超一流的文字。

Thank you.

谢谢你!

2 个解决方案

#1


49  

Assuming you're using the bash shell, you'll want to edit either your ~/.bashrc or ~/.bash_profile with:

假设您正在使用bash shell,您将希望编辑您的~/。bashrc或(~ /。bash_profile:

export EDITOR=<editor name>

Example, specifically for Sublime:

例子中,专门为崇高:

export EDITOR='subl -w'

See: Sublime OS X Command Line docs

参见:崇高的OS X命令行文档

#2


7  

As @sixty4bit mentioned,

正如@sixty4bit提到的,

export EDITOR='subl -w' 

will raise error for command bundle open gem_name

会引起命令包打开gem_name的错误吗

But if I use

但是如果我使用

export EDITOR='subl'

Then sublime will not write commit message to git commit correctly for command git commit.

然后sublime将不会为命令git提交而向git提交正确的提交消息。

So I think it is better to use this config:

所以我认为最好使用这个配置:

export EDITOR="subl -w"
export BUNDLER_EDITOR="subl"

#1


49  

Assuming you're using the bash shell, you'll want to edit either your ~/.bashrc or ~/.bash_profile with:

假设您正在使用bash shell,您将希望编辑您的~/。bashrc或(~ /。bash_profile:

export EDITOR=<editor name>

Example, specifically for Sublime:

例子中,专门为崇高:

export EDITOR='subl -w'

See: Sublime OS X Command Line docs

参见:崇高的OS X命令行文档

#2


7  

As @sixty4bit mentioned,

正如@sixty4bit提到的,

export EDITOR='subl -w' 

will raise error for command bundle open gem_name

会引起命令包打开gem_name的错误吗

But if I use

但是如果我使用

export EDITOR='subl'

Then sublime will not write commit message to git commit correctly for command git commit.

然后sublime将不会为命令git提交而向git提交正确的提交消息。

So I think it is better to use this config:

所以我认为最好使用这个配置:

export EDITOR="subl -w"
export BUNDLER_EDITOR="subl"