Search code examples
ruby-on-railsrubyruby-on-rails-5.2codeanywhere

Codeanywhere can't find editor for Rails 5.2.1 app


I am having difficulty accessing the command: rails credentials:edit using the Codeanywhere environment. I am running Rails 5.2.1 and Ruby 2.5.1.

I receive the following response from the terminal:

No $EDITOR to open file in. Assign one like this:

EDITOR="mate --wait" bin/rails credentials:edit

For editors that fork and exit immediately, it's important to pass a
wait flag, otherwise the credentials will be saved immediately 
with no chance to edit.

I don't seem to be able to get this working.

Can someone please help?

Thank you.


Solution

  • This means that you haven't set the environment variable that determines your editor. The example in the output will make TextMate your default editor.

    Not sure what editors are available in CodeAnywhere, but most systems have access to VIM, so you might try running:

    EDITOR="vim --wait" bin/rails credentials:edit

    You may not need to pass the --wait option.