Bundler::GemNotFound Error - ruby

I'm using Ubuntu. I tried installing bundler via 'gem install bundler', and it seems to have worked. In terminal, if I type 'gem list', I see bundler 1.3.5 in the list. However, if I run 'bundle install', I get the error 'Bundler::GemfileNotFound'... I'm not sure why

It's likely the bundle binary is not in your path.
You can check this by executing the following:
echo $PATH
which bundle
If your bundle path is: /Users/xxx/.rbenv/shims/bundle
Your PATH needs to include: /Users/xxx/.rbenv/shims
https://askubuntu.com/questions/60218/how-to-add-a-directory-to-my-path

Bundler is looking for a file called Gemfile in your current directory. The error means that it isn't there. Are you sure you're in the right directory?

Related

tootlcrl error: Could not find concurrent-ruby-1.1.10 in any of the sources

I'm trying to run a tootctl command, but am running into a problem with it not being able to detect the required dependency is not present.
Could not find concurrent-ruby-1.1.10 in any of the sources
I have run bundle install and the gems get installed (or are confirmed already installed), but the command still has trouble not finding the
Using concurrent-ruby-1.1.10
...dozens of other packages
Using rails-settings-cached 0.6.6
Bundle complete! 122 Gemfile dependencies, 225 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `../vendor/bundle`
then I attempt the command again..
me#mastodon-vm:/var/www/mastodon/bin$ ./tootctl media remove --days=7
Could not find concurrent-ruby-1.1.10 in any of the sources
Run `bundle install` to install missing gems.
me#mastodon-vm:/var/www/mastodon/bin$
but I'm back to the same problem. What is the typical approach to fix this?
Note: I did try to follow the guidance in this SO post, but it broke the entire installation. I was able to save it by replacing Gemfile and Gemfile.lock from Mastodon's source (phew)
Your log shows
Gems in the groups 'development' and 'test' were not installed.
Try to install your Gems with
bundle install --with development test
or run
RAILS_ENV=production tootctl
According to https://rubygems.org/gems/concurrent-ruby/versions/1.1.10 the gem is named "concurrent-ruby". When I run gem install concurrent-ruby, it is installed successfully on my computer.

Middleman command not found/ Bundler not working

I'm trying to install middleman. I installed the gem and can see it in my gem list. However, if I enter middleman -v I get the message middleman: command not found.
I tried installing bundler to run middleman with a Gemfile in the project directory using bundle exec middleman. But when I try to run bundle I get the following error:
bash: /usr/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
I'm running ruby v. 2.6 and installed middleman v.4.3.5 on Ubuntu 18.04.
Any help would be very much appreciated; I've wasted half a day trying to solve this and I'm still on high waters!
which ruby gives me /snap/bin/ruby and my path variable is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/share/rvm/bin. The problem is that ruby is in the snap folder.
I just uninstalled the ruby snap (and snaps in general) and installed "normal" Ruby, which had the correct path (usr/bin/ruby). The middleman installation then worked fine.

How to run Bundle after installing?

I have done
gem install bundle
inside my directory that I have a git repository. But now when I try to run it with
bundle
run bundle
bundle install
it says:
Could not locate Gemfile.
How would I check that it has installed ?
It looks like it installed the gem correctly, however, you need to create a file named Gemfile for bundler to know what gems it should install. This file should be in your project's root. You can create one manually, or run bundle init to have a default one generated.
You can read more about the Gemfile in the docs

Running 'bundle install' ruby

I've been trying to run a bundle install and I always seem to get the same error 'Could not locate Gemfile or .bundle/ directory'
If someone could explain a possibility of why I may be getting this it would be very helpful
Thanks :)
To confirm which file bundler is trying to use as its Gemfile, try this:
bundle exec ruby -e "puts ENV['BUNDLE_GEMFILE']"
To make sure you don't have a setting that's causing bundler not to use the Gemfile in your current (or a parent) directory, try this:
bundle config Gemfile

Getting error that rake is missing despite the fact that it's there

$ sudo ./msfconsole
Could not find rake-10.1.0 in any of the sources
Run `bundle install` to install missing gems.
$ rake --version
rake, version 10.1.0
Does anyone know what could cause this?
I tried running bundle install, but when I try to run msfconsole again afterwards it throws the error again.
It might be a PATH-related issue.
Try it with sudo -E, so that your PATH, gem locations, etc. all become available when running sudo.
Other possibilities might be detailed in these related questions:
Could not find rake with bundle exec
bundle exec fails with "could not find rake-10.1.0 in any of the sources"
Could not find rake-10.1.0 in any of the sources

Resources