4

I just got Rubymine and getting used to ruby on rails on mac. I'm wondering if there is any command to open a ruby app on Rubymine 7, from terminal.

Would there be a command like this?

$ Rubymine /Path/to/RubyApp
Luuklag
  • 3,897
  • 11
  • 38
  • 57
stringRay2014
  • 636
  • 1
  • 11
  • 29

7 Answers7

19

RubyMine has a special menu item for that. In ver. 8, 'Tools' > 'Create command-line launcher ...' Previous versions should keep the item somewhere around.

user3734466
  • 191
  • 1
  • 2
8

Once you've created command-line launcher (Tools > Create Command-Line Launcher), you can use the command mine via the command line..

e.g. If you have navigated to a folder via the command line, that you then want to open with Rubymine, you can run mine .

JennaR
  • 81
  • 1
  • 1
3

it's enough to append the following line into your ~/.bashrc or ~/.zshrc

alias rubymine="open -a rubymine"

reference Use Typora from Shell or Cmd

TorvaldsDB
  • 766
  • 9
  • 8
2

The standard way to do it on bash/OSX from the JetBrains site:

$<RubyMine> <path1> --line<number> <path2>

That's the launcher, the path to the project, the line you want the file to open to and the path to the file in order. An example would be: /Applications/RubyMine.app/Contents/MacOS/rubymine ~/RubyMineProjects/untitled45 --line 1 ~/RubyMineProjects/untitled45/sample.sass These can be pretty long commands, but you can create a symlink to shorten the launcher at least.

Keep in mind that launching from the command line launches with the ruby version you have set there as well as any other command line configs. If you want to keep configurations from the editor you should open the project the conventional way.

BarFooBar
  • 1,086
  • 2
  • 13
  • 32
0

For RubyMine 2017.1.5, just type Alt + F12 for local terminal

Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
0

Just go to folder where Rubymine is download.Then go to Rubymine bin folder. And run command from console. In my case

   kashif@kashif-HP-ProBook-4520s:~/Downloads/RubyMine-2017.1.6/bin$ ./rubymine.sh 
Kashiftufail
  • 10,815
  • 11
  • 45
  • 79
0

Previous answers didn't help me (using RubyMine 2020.1)

Instructions for Mac (different OSs also described on rubymine docs):

  1. Create a script:

You can create a shell script with this command in a directory from your PATH environment variable. For example, create the file /usr/local/bin/rubymine with the following contents:

#!/bin/sh

open -na "RubyMine.app" --args "$@"
  1. Tada! Assuming that script is executable (in case not - run chmod +x /usr/local/bin/rubymine) Now you are able to navigate to proper directory and run rubymine . to run RubyMine for that directory

If you want to play around with different args passed while starting RubyMine, check rubymine docs.

Rigi
  • 2,870
  • 1
  • 9
  • 18