简体   繁体   English

我该如何修复带有Rails-vim插件的vim中的'/ bin / bash /:命令未找到'?

[英]How do I fix '/bin/bash/: command not found' in vim w/ rails-vim plugin?

I'm using gvim and rails.vim and getting the following error when attempting to run :Rake from within a migration: 我正在使用gvim和rails.vim并尝试从迁移中运行:Rake时出现以下错误:

:!rake db:migrate VERSION=20100427002644 2>&1| tee /tmp/v436868/11 
/bin/bash/: rake: command not found

I'm not sure how to troubleshoot this. 我不确定如何解决此问题。 What can I do to fix this? 我该怎么做才能解决此问题?

Edit: 编辑:

If i run rake --version from the terminal it works fine. 如果我从终端运行rake --version ,它将正常工作。

Looks like rake isn't on your path. 看起来耙子不在路上。 Make sure that $PATH includes wherever the 'rake' executable is. 确保$ PATH包括“ rake”可执行文件所在的位置。

OP's following comment gives a workaround, which I would consider an answer: OP的以下评论提供了一种解决方法,我将考虑一个答案:

When I open gvim from an ubuntu menu my path is incorrect. 当我从ubuntu菜单打开gvim时,我的路径不正确。 However, opening from a terminal sets the correct path and the rake command works. 但是,从终端打开会设置正确的路径,并且rake命令会起作用。

(I don't have enough reputation to upvote that comment.) (我没有足够的声誉来支持该评论。)

Rake isn't in your $PATH . Rake不在$PATH I suppose you're using rvm , which operates via .bashrc to add rake to your $PATH . 我想您正在使用rvm ,它通过.bashrc进行操作,以将rake添加到$PATH I'm not sure :!source ~/.bashrc helps. 我不确定:!source ~/.bashrc帮助。 Some .bashrc got [ -z "$PS1" ] && return to check for an interactive session on top. 一些.bashrc得到了[ -z "$PS1" ] && return以检查顶部的交互式会话。 Be sure the rvm include is above that line. 确保rvm include在该行上方。

[root@localhost ~]# cp /usr/local/sbin/keepalived /usr/sbin/

[root@localhost ~]# /etc/init.d/keepalived start
Starting keepalived:                                       [  OK  ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 带oa缓冲区的vim插件命令 - vim plugin command w/o a buffer 如何为Vim安装Rails插件? - How to install rails plugin for vim? Vim:使用rails.vim,如何让rails.vm使用rspec而不是testunit? - Vim: Using rails.vim, how do I make rails.vm use rspec instead of testunit? Vim ruby​​,rails omnicompletion:“加载rails环境时出错”。 如何配置vim-ruby的自动完成功能以使用rails? - Vim ruby, rails omnicompletion: “Error loading rails environment”. How do I configure vim-ruby's autocomplete to work with rails? 如何使用 rails 2.1 中的 ExceptionNotifier 插件修复“找到未处理的视图路径”错误? - How do I fix 'Unprocessed view path found' error with ExceptionNotifier plugin in rails 2.1? Vim rails.vim插件似乎不起作用 - Vim rails.vim plugin doesn't seem to work 使用Vim编辑Rails项目时,SnipMate插件仅加载红宝石代码段。 如何获得红宝石代码段? - When editting a Rails project with Vim, the SnipMate plugin only loads the ruby snippets. How can I get the ruby-rails snippets? -bash:rails:找不到命令 - -bash: rails: command not found 如何在Vim中缩进Ruby和Rails代码? - How can I indent Ruby and Rails code in Vim? 如何在VIM + Rails.vim + Ubuntu中运行当前的RSpec测试? - How to run current RSpec test in VIM + Rails.vim + Ubuntu?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM