【问题标题】:Ruby bundle command not found找不到 Ruby 捆绑命令
【发布时间】:2015-04-23 13:20:07
【问题描述】:

当我使用命令 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 export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"

但我仍然遇到 bundler: command not found 的问题。我不能再进一步了,求助!

【问题讨论】:

    标签: ruby gem command bundle


    【解决方案1】:

    只是一个ruby脚本,ruby newvm.rb应该足够了。

    如果你想在 bundle 上下文中运行它,那么:

    bundle exec ruby newvm.rb

    【讨论】:

      【解决方案2】:

      我在我的项目中运行 bundle install 命令时遇到了问题。我发现您必须更改这两个文件:(都在您的 Ruby bin 目录中)

      bundle.bat

      bundle.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" %*
      

      【讨论】:

        猜你喜欢
        • 2015-07-08
        • 2011-04-24
        • 1970-01-01
        • 2023-03-18
        • 2012-12-03
        • 1970-01-01
        • 2022-06-14
        • 2013-07-03
        • 2014-06-10
        相关资源
        最近更新 更多