Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure rubymine with vagrant and rbenv

I have a rails project with the following development environment:

  • Host machine: MacOS 10.8
  • Vagrant with precise 64
  • Rubymine
  • Rbenv

Everything works fine: rbenv is installed in the guest machine, and my rails server is started on port 3000 in the guest machine, and forwarded onto the host (config in Vagrant file).

I would like Rubymine (installed on the host machine) to use the SDK inside vagrant, and the gems inside Vagrant, and inside rbenv.

How can I do that ?


To be clear:

Host machine -> OSX
Guest machine -> Lucid64 in vagrant
like image 866
Benjamin Crouzier Avatar asked Oct 29 '13 15:10

Benjamin Crouzier


People also ask

What is Rbenv shims Ruby?

rbenv/shims . The job of the shims is to grab the directory for your desired version of Ruby and stick it at the beginning of your $PATH and then execute the corresponding binaries. rbenv requires you to install each version of Ruby in the ~/. rbenv/versions directory.

What is Rbenv?

rbenv localSets a local application-specific Ruby version by writing the version name to a . ruby-version file in the current directory. This version overrides the global version, and can be overridden itself by setting the RBENV_VERSION environment variable or with the rbenv shell command.

What is the use of RubyMine?

RubyMine is an integrated development environment (IDE) that helps you be more productive in every aspect of Ruby/Rails projects development - from writing and debugging code to testing and deploying a completed application. RubyMine is available for different platforms including macOS, Windows, and Linux.


1 Answers

In rubymine:

  • go to options (command+,)
  • search SDK in options,
  • click Add SDK / new remote
  • click Fill from Vagrant config and select the folder where your Vagrantfile is located
  • Very important: In the field Ruby interpreter path, put /home/vagrant/.rbenv/versions/2.0.0-p247/bin/ruby (your ruby version may change, check your versions with ls /home/vagrant/.rbenv/versions in your guest machine
  • Click OK, grab a cofee
  • Your're done
like image 101
Benjamin Crouzier Avatar answered Oct 11 '22 22:10

Benjamin Crouzier