2015-04-23 140 views
0

當我使用命令bundle exec newvm.rb,我得到的消息紅寶石束找不到命令

bundler: command not found: newvm.rb 
Install missing gem executables with `bundle install` 

我知道有有此問題的幾個人,但與所有其他人工作的解決方案,非工作過爲了我。

我也做了以下內容:

  1. gem bundler install
  2. bundle install
  3. which gem => /home/$user/.rbenv/shims/gem
  4. which bundle => /home/$user/.rbenv/shims/gem
  5. rbenv rehash(捆綁安裝後)
  6. .bashrc出口PATH =「$ HOME /。 rbenv/bin:$ PATH「eval」$(rbenv init - )「

但即時通訊仍然存在bundler:命令未找到的問題。我不能再得到任何幫助!

回答

1

這只是一個Ruby腳本,ruby newvm.rb應該夠了。

如果你想在束上下文中運行它,然後做:

bundle exec ruby newvm.rb

+0

哎呀,我一直很忙,我忘了! – 5qFf3dmhkQ

0

我經歷了運行包從我的項目install命令的問題。我發現你不得不改變這兩個文件:(無論是在你的Ruby bin目錄)

bundle.bat

bundler.bat

兩個文件都指向到Ruby的路徑不正確的引用。我將它們改爲指向正確的Ruby路徑,現在該命令起作用。這可能會幫助我希望的其他人。這是我係統的例子。您需要根據您在系統上安裝Ruby的位置更改您的設置。

@ECHO OFF 

IF NOT "%~f0" == "~f0" GOTO :WinNT 

@"C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe" "C:\RailsInstaller\Ruby2.2.0\bin\bundle" %1 %2 %3 %4 %5 %6 %7 %8 %9 

GOTO :EOF 

:WinNT 

@"C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe" "%~dpn0" %*