Unable to install bundler with gem - ruby

I am using ruby 2.6.5 and I try to install bundler -v 2.2.27 gem according to documentation using this command:
gem install bundler -v 2.2.27 --default
And this is the output I get:
gem install bundler -v 2.2.27 --default
Successfully installed bundler-2.2.27 as a default gem
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory # dir_chdir - /Users/jedrek/.rvm/gems/ruby-2.6.5/specifications/gems/bundler-2.2.27
It says it installed the gem but errors out at the same time :)
When I check current version of bundler I get this output
gem info bundler
*** LOCAL GEMS ***
bundler (2.2.32, 2.2.27, 2.2.24, 2.1.4)
Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
Terence Lee, Carl Lerche, Yehuda Katz
Homepage: https://bundler.io
License: MIT
Installed at (2.2.32): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.2.27, default): /Users/jedrek/.rvm/rubies/ruby-2.6.5/lib/ruby/gems/2.6.0
(2.2.24): /Users/jedrek/.rvm/gems/ruby-2.6.5
(2.1.4): /Users/jedrek/.rvm/gems/ruby-2.6.5
As you can see it says that bundler -v 2.2.27 is installed.
When I try to install dependencies in my project I get this error:
bundle install
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 2.2.27)
Current Bundler version:
bundler (2.1.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 2.2.27)' in any of the relevant sources:
the local ruby installation
Listing current bundler version locally shows this output
gem list bundler
*** LOCAL GEMS ***
bundler (2.2.32, default: 2.2.27, 2.2.24, 2.1.4)
bundler-audit (0.7.0.1, 0.6.1)
capistrano-bundler (2.0.1, 1.3.0)
I am so confused. Is this is a bug?
I am using rubygems 3.2.27
gem --version
3.2.27
UPDATE
I tried upgrading rubygems to 3.2.32 and have the same issue.

Related

bundler version claims to exist, but does not

How can this be explained and remedied?
-bash> gem list bundler
*** LOCAL GEMS ***
bundler (default: 2.2.21)
-bash> bundler --version
Bundler version 2.1.4
-bash> gem uninstall bundler:2.1.4
Gem 'bundler' is not installed
-bash> gem environment | grep INSTALL
- INSTALLATION DIRECTORY: /Users/me/.rbenv/versions/2.7.4/lib/ruby/gems/2.7.0
- USER INSTALLATION DIRECTORY: /Users/me/.gem/ruby/2.7.0
-bash> find /Users/me/.rbenv/versions/2.7.4/ -name "bundler*"
/Users/me/.rbenv/versions/2.7.4//bin/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/2.7.0/rubygems/bundler_version_finder.rb
/Users/me/.rbenv/versions/2.7.4//lib/ruby/2.7.0/exe/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/2.7.0/bundler.rb
/Users/me/.rbenv/versions/2.7.4//lib/ruby/2.7.0/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/specifications/default/bundler-2.2.21.gemspec
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/cache/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/cache/bundler-2.2.21.gem
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/doc/bundler-2.2.21
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/doc/bundler-2.2.27
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/bootsnap-1.8.1/lib/bootsnap/bundler.rb
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/bundler-2.2.21
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/bundler-2.2.21/exe/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/rubocop-1.13.0/lib/rubocop/cop/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/bootsnap-1.7.4/lib/bootsnap/bundler.rb
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/rubocop-1.21.0/lib/rubocop/cop/bundler
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/gems/simplecov-0.17.1/lib/simplecov/profiles/bundler_filter.rb
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/bundler
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/LockfileParser/bundler_version-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/bundler_major_version-c.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/Standalone/bundler_path-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/Plugin/API/Source/bundler_plugin_api_source%3f-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/Fetcher/bundler_cert_store-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/CLI/Gem/bundler_dependency_version-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Bundler/SharedHelpers/bundler_ruby_lib-i.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Gem/BundlerVersionFinder/bundler_version_with_reason-c.ri
/Users/me/.rbenv/versions/2.7.4//share/ri/2.7.0/system/Gem/BundlerVersionFinder/bundler_version-c.ri
I cannot explain it, but the remedy is:
Remove bundler-2.2.21.gemspec from the folder that renders it default:
Reinstall the desired version.
Uninstalling bundler will not work:
-bash> gem uninstall bundler
Gem bundler-2.2.21 cannot be uninstalled because it is a default gem
Note the following line in the output of the find command above:
/Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/specifications/default/bundler-2.2.21.gemspec
Remove it in order to remove the "default" status of this gem:
rm /Users/me/.rbenv/versions/2.7.4//lib/ruby/gems/2.7.0/specifications/default/bundler-2.2.21.gemspec
Uninstalling is now impossible...
-bash> gem uninstall bundler
Gem 'bundler' is not installed
Indeed...
-bash> bundler --version
Traceback (most recent call last):
2: from /Users/me/.rbenv/versions/2.7.4/bin/bundler:23:in `<main>'
1: from /Users/me/.rbenv/versions/2.7.4/lib/ruby/2.7.0/rubygems.rb:296:in `activate_bin_path'
/Users/me/.rbenv/versions/2.7.4/lib/ruby/2.7.0/rubygems.rb:277:in `find_spec_for_exe': Could not find 'bundler' (2.1.4) required by your /Users/me/Projects/kinside/kinside/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.1.4`
So install the desired version:
-bash> gem install bundler:2.2.21
Successfully installed bundler-2.2.21
Parsing documentation for bundler-2.2.21
Installing ri documentation for bundler-2.2.21
Done installing documentation for bundler after 3 seconds
1 gem installed
Check:
-bash> bundler --version
Bundler version 2.2.21
-bash> gem list bundler
*** LOCAL GEMS ***
bundler (2.2.21)

Error when running msfconsole in Pentestbox

In PENTESTBOX I want to run METASPLOIT-FRAMEWORK by running command msfconsole
and it is giving the following error ``
Bundler could not find compatible versions for gem "ruby ":
In Gemfile:
ruby x86-mingw32
metasploit-framework x86-mingw32 was resolved to 5.0.83, which depends on
ruby (>= 2.5) x86-mingw32
Could not find gem 'ruby (>= 2.5)', which is required by gem 'metasploit-framework', in any of the relevant sources:
the local ruby installation
To fix your issue run
gem install bundler -v 1.12
bundle _1.12_ install

after bundler installed with specific version why version of bundler did not change?

I got following error for bundle
Bundler could not find compatible versions for gem "bundler": In
Gemfile:
bundler (~> 1.15)
Current Bundler version:
bundler (2.0.1) This Gemfile requires a different version of Bundler. Perhaps you need to update Bundler by running gem install
bundler?
Could not find gem 'bundler (~> 1.15)' in any of the relevant sources:
the local ruby installation
then I tried to downgrade the bundler version with
$ gem install bundler -v '~> 1.7.0' Fetching: bundler-1.7.15.gem
(100%) Successfully installed bundler-1.7.15 Parsing documentation for
bundler-1.7.15 Installing ri documentation for bundler-1.7.15 Done
installing documentation for bundler after 1 seconds 1 gem installed
but when I recheck the bundler version with
bundler --version
it still said Bundler version 2.0.1
The default bundler version on your system is still 2.0.1. If you need to use the downloaded version 1.7.15, you would have to run bundle _1.7.15_ install. You could also check if that version was successfully installed on your system using bundle _1.7.15_ -v
In either case, if you get the error Could not find command "_1.7.15_", then that means that the bundler version _1.7.15_ has not been installed on your system.
Additionally, these links may help you:
Run specific version of bundler
Downgrade Bundler in RVM
Try updating bundle with bundler update bundler and run the bundle update again. It solved my problem the last time.

jekyll-docs not installing on macOS

Jekyll's document says,
If you’re interested in browsing these docs on-the-go, install the
jekyll-docs gem and run jekyll docs in your terminal.
When I tried to install jekyll-docs on my MacBook Air running macOS Sierra, I bumped into the following problem:
sunqingyaos-MacBook-Air:myblog sunqingyao$ jekyll docs
You must install the 'jekyll-docs' gem to use the 'jekyll docs' command.
sunqingyaos-MacBook-Air:myblog sunqingyao$ sudo gem install jekyll-docs
Successfully installed jekyll-docs-3.3.0
Parsing documentation for jekyll-docs-3.3.0
1 gem installed
sunqingyaos-MacBook-Air:myblog sunqingyao$ jekyll docs
You must install the 'jekyll-docs' gem to use the 'jekyll docs' command.
sunqingyaos-MacBook-Air:myblog sunqingyao$
As you can see, rubygems told me it has successfully installed jekyll-docs-3.3.0, while jekyll docs kept falling. I've restarted the terminal, still not working.
Had the same issue.
In my case I had two jekyll gems:
sergpank$ gem list jekyll
*** LOCAL GEMS ***
jekyll (3.4.0, 3.3.1)
jekyll-docs (3.3.1)
jekyll-feed (0.8.0)
jekyll-sass-converter (1.5.0)
jekyll-watch (1.5.0)
I have simply uninstalled 3.4.0 (because there was no jekyll-docs-3.4.0):
sergpank$ gem uninstall jekyll -v 3.4.0
Successfully uninstalled jekyll-3.4.0
---------------------------------------
sergpank$ gem list jekyll
*** LOCAL GEMS ***
jekyll (3.3.1)
jekyll-docs (3.3.1)
jekyll-feed (0.8.0)
jekyll-sass-converter (1.5.0)
jekyll-watch (1.5.0)
After what jekyll docs was successfully started!

gem check errors (registered but missing gems) after installing ruby 2.0.0-p0 with rbenv install

Everything works fine with my installation of ruby 1.9.3.
$ rbenv global 1.9.3-p385
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.1.0)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.5)
$ gem check
$
However after I installed ruby 2.0.0 with rbenv install, some strange error messages showed up in gem check.
$ rbenv install 2.0.0-p0
Downloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...
Installed openssl-1.0.1e to /Users/gogao/.rbenv/versions/2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/gogao/.rbenv/versions/2.0.0-p0
$ rbenv global 2.0.0-p0
$ rbenv rehash
$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.0)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
psych (2.0.0)
rake (0.9.6)
rdoc (4.0.0)
test-unit (2.0.0.0)
$ gem check
Checking gems...
bigdecimal-1.2.0.gem has 1 problems
bigdecimal-1.2.0:
Gem registered but doesn't exist at /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/bigdecimal-1.2.0
io-console-0.4.2.gem has 1 problems
io-console-0.4.2:
Gem registered but doesn't exist at /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/io-console-0.4.2
json-1.7.7.gem has 1 problems
json-1.7.7:
Gem registered but doesn't exist at /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/json-1.7.7
minitest-4.3.2.gem has 1 problems
minitest-4.3.2:
Gem registered but doesn't exist at /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/minitest-4.3.2
psych-2.0.0.gem has 1 problems
psych-2.0.0:
Gem registered but doesn't exist at /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/gems/psych-2.0.0
rake-0.9.6.gem has 2 problems
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/rake-0.9.6.gem:
missing gem file /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/rake-0.9.6.gem
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/specifications/rake-0.9.6.gemspec:
Spec file missing for installed gem
rdoc-4.0.0.gem has 2 problems
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/rdoc-4.0.0.gem:
missing gem file /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/rdoc-4.0.0.gem
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/specifications/rdoc-4.0.0.gemspec:
Spec file missing for installed gem
test-unit-2.0.0.0.gem has 2 problems
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/test-unit-2.0.0.0.gem:
missing gem file /Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/cache/test-unit-2.0.0.0.gem
/Users/gogao/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0/specifications/test-unit-2.0.0.0.gemspec:
Spec file missing for installed gem
$
Is it a known bug? or am i doing something wrong?
For Ruby 2.0.0-p0, I also get similar warnings from gem check. However, I don't have issues at runtime with any of these gems. I suspect this might be a bug with Rubygems check command in 2.0.0.
I have similar errors. Passing options to compiler fix installation.
Before install readline and openssl with Homebrew.
RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)
--with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.0.0-p0
More info from Original Post

Resources