stringRay2014
stringRay2014

Reputation: 646

Can I open the ruby app from Rubymine terminal

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

Upvotes: 5

Views: 8778

Answers (7)

TorvaldsDB
TorvaldsDB

Reputation: 972

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

Upvotes: 3

Rigi
Rigi

Reputation: 3480

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.

Upvotes: 0

JennaR
JennaR

Reputation: 81

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 .

Upvotes: 8

Kashiftufail
Kashiftufail

Reputation: 10885

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 

Upvotes: 0

chocolate sar
chocolate sar

Reputation: 1

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

Upvotes: 0

user3734466
user3734466

Reputation: 201

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

Upvotes: 20

BarFooBar
BarFooBar

Reputation: 1136

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.

Upvotes: 2

Related Questions