Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using RVM with GVim (Cream): rvm command not found

I am trying to move to GVim(cream) as my primary editor on Ubuntu. I am using the wonderful rails.vim, however I also am using RVM.

Rvm works fine when doing things in a shell, and the ruby version I would like to use in rails.vim is the version set as default (but not the system version).

When I try to run things like

:Rgenerate migration migration_name

I get:

...
Missing Rails 2.3.8 gem.
...

If I try:

:!rvm use default

I get:

/bin/bash: rvm: command not found

Obviously cream/gvim is not using my .bashrc. What can I do to remedy this and get it working? Thanks.

like image 286
Alan Peabody Avatar asked Jun 17 '10 17:06

Alan Peabody


3 Answers

Try running cream from the command line, if this solves the issue you can point your menu item to a script that opens cream in the context of a bash prompt.

like image 78
thomasfedb Avatar answered Nov 04 '22 06:11

thomasfedb


This is because you are sourcing the rvm scripts in your .zshrc file. MacVim does not source the .zshrc file, but will source the .zshenv file.

Add following line to your .vimrc file.

set shell=/bin/sh
like image 30
Aslam Najeebdeen Avatar answered Nov 04 '22 08:11

Aslam Najeebdeen


You probably have used .bash_profile to add RVM stuff to your bash environment. Alas, ~/.bash_profile won't normally be read by X startup scripts, as stated in Ubuntu Help

Use .profile or .bashrc. The .profile is only sourced by bash if .bash_profile is not there. I would use .bashrc.

like image 1
fungusakafungus Avatar answered Nov 04 '22 06:11

fungusakafungus