5qFf3dmhkQ
5qFf3dmhkQ

Reputation: 15

Ruby bundle command not found

When I use the command bundle exec newvm.rb, I get the message that

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

I know there are several people having this problem but with all the solutions that worked for other people, non have worked for me.

I have done the following:

  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(after bundler install)
  6. .bashrc export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)"

But im still having the problem that bundler: command not found. And i cant get any further, help!

Upvotes: 0

Views: 6103

Answers (2)

Charles Owen
Charles Owen

Reputation: 2900

I experienced issues running the bundle install command from my project. I found you had to change these two files:(both in your Ruby bin directory)

bundle.bat

bundler.bat

Both files are pointing to incorrect references to the Ruby path. I changed them to point to the correct Ruby path and now the command works. This may help others I hope. This is the example for my system. You would need to change yours according to where you've installed Ruby on your system.

@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" %*

Upvotes: 0

xdazz
xdazz

Reputation: 160923

It's just a ruby script, ruby newvm.rb should be enough.

If you want to run it under bundle context, then do:

bundle exec ruby newvm.rb

Upvotes: 1

Related Questions