Search code examples
rubyrubygemscommandbundle

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!


Solution

  • 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