简体   繁体   中英

vim-rails: No such file or directory when doing Rserver

Can't find anything about this in Google. Trying to get most out of vim-rails .

https://github.com/tpope/vim-rails

It has many interesting commands, like :Rserver , :Rgenerate , :Rdestroy , but they do not work on my machine. All they give same error:

No such file or directory

I would imagine it has something to do with paths, and RVM loading, but not sure what exactly. Running on latest Lubuntu if that matters. Sometimes need to do /bin/bash --login to run rake.

-- Found somewhere that in ~/.profile I should put this:

# PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM

Still same error.

-- Yes, vim-rails - is a plugin for vim that I'm trying to use.

-- Tried to run !/bin/bash --login from VIM - but it closes VIm.

Have you try to execute these commands in the normal way? like rails server , rails generate ..

From your description, mostly because vim-rails can't find ruby or rails command to execute.

You should check the $PATH variable to see whether it has ruby or rails load path in it.

Have you tried to open vim in your working directory?

For example, if your app is in ~/workspace/my_project/ , then you should open vim in that directory:

cd ~/workspace/my_project
vim

Then the vim-rails should work as expected.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM