narendra#narendra-laptop:~/rails_project/sample_app$ sudo gem install ZenTest
[sudo] password for narendra:
ERROR: Error installing ZenTest:
ZenTest requires RubyGems version ~> 1.8. Try 'gem update --system' to update RubyGems itself.
narendra#narendra-laptop:~/rails_project/sample_app$ gem update --system
Latest version currently installed. Aborting.
narendra#narendra-laptop:~/rails_project/sample_app$ gem --version
1.8.10
narendra#narendra-laptop:~/rails_project/sample_app$
Try gem install ZenTest without the sudo.
Related
I've just removed rbenv as i wanted to install a newer Ruby version (2.6) than the ones available for rbenv, then installed Ruby 2.6, that went fine, now while trying to reinstall all the gems for my app I ran into the following problem:
$ bundle install
Installing signet 0.14.0
Gem::InstallError: signet requires Ruby version >= 2.4.0.
An error occurred while installing signet (0.14.0), and Bundler cannot continue.
Make sure that `gem install signet -v '0.14.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
google_drive was resolved to 2.1.12, which depends on
google-api-client was resolved to 0.21.2, which depends on
googleauth was resolved to 0.6.7, which depends on
signet
But ruby has clearly been upgraded:
$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux-gnu]
and if I try to install signet manually it works fine:
gem install signet -v '0.14.0' --source 'https://rubygems.org/'
Successfully installed signet-0.14.0
Parsing documentation for signet-0.14.0
Done installing documentation for signet after 0 seconds
1 gem installed
But then if i run bundle install again I still get the same problem. I've also tried bundle install --path vendor/cache and bundle install --system to no avail.
Note that the gems seem to install in the right place:
gem which signet
/var/lib/gems/2.6.0/gems/signet-0.14.0/lib/signet.rb
if I compare it to another one installed by bundler:
gem which multi_json
/var/lib/gems/2.6.0/gems/multi_json-1.14.1/lib/multi_json.rb
This is on Ubuntu 16.04.4 LTS and bundler 1.16.3
How do I fix this?
So I've finally figured it out, installing a newer version of bundler (but < 2.0 as Rails 4.2 requires it) did the trick, although i also had to uninstall the ruby 2.2-dev package and install the 2.6-dev package to be able to compile native gems like nokogiri, then running the whole thing specifying the bundler version.
For those interested, these were the commands:
apt-get remove ruby-dev
apt install ruby2.6-dev
gem install bundler -v 1.17.3
bundle _1.17.3_ install
I had a problem with Bundler (bundle cannot load such file bundler-1.17.1/exe/bundle), so I removed Bundler then manually removed all bundler directory:
gem uninstall bundler -x
gem cleanup bundler
Then removed with rm -rf from:
~/.gem/ruby/2.5.1/gems/bundler-1.17.1
~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1
and ~/.bundle
Now, I would like to reinstall bundler with the default version, 1.17.1.
So I tried gem install bundler
gem install bundler
Fetching: bundler-1.17.1.gem (100%)
Successfully installed bundler-1.17.1
Parsing documentation for bundler-1.17.1
Installing ri documentation for bundler-1.17.1
Done installing documentation for bundler after 3 seconds
1 gem installed
If I try to execute a bundle command, I get this error:
bundle
Traceback (most recent call last):
1: from /Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `<main>'
/Users/robin/.gem/ruby/2.5.1/bin/bundle:23:in `load': cannot load such file -- /Users/robin/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1/exe/bundle (LoadError)
I can see bundler-1.17.1 in ~/.gem/ruby/2.5.1/gems/bundler-1.17.1 but not in .rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1. So I have to manually copy the folder:
cp -R ~/.gem/ruby/2.5.1/gems/bundler-1.17.1 ~/.rubies/ruby-2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.17.1
But now, if I try a bundle command, it works but I have this message in first line:
Warning: the running version of Bundler (1.16.2) is older than the version that created the lockfile (1.16.6). We suggest you upgrade to the latest version of Bundler by running 'gem install bundler'.
I tried to install bundler by gem install bundler -v 1.17.1 but I still have the problem.
gem list output:
gem list bundler
*** LOCAL GEMS ***
bundler (default: 1.17.1)
capistrano-bundler (1.4.0, 1.3.0)
my config:
macOS 10.13.6
ruby -v
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
chruby
ruby-2.5.0
* ruby-2.5.1
rails -v
Rails 5.2.1
gem -v
2.7.7
EDIT:
I forgot to specify than gem pristine bundler doesn't work with bundler:
gem pristine bundler
Restoring gems to pristine condition...
Skipped bundler-1.17.1, it is a default gem
And if I try to uninstall bundler twice, I get this message:
gem uninstall bundler -x
ERROR: While executing gem ... (Gem::InstallError)
gem "bundler" cannot be uninstalled because it is a default gem
So i don't know if bundler is really uninstalled the first time.
I am trying to install Solidus gem which is a fork of spree and while running bundle install this shows up
Installing solidus_core 1.1.0
Gem::InstallError: solidus_core requires Ruby version >= 2.1.0.
An error occurred while installing solidus_core (1.1.0), and Bundler cannot
continue.
even when I am running ruby version 2.2.3
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
I am using rbenv on OS X El Capitan to control the ruby versions. Is there a problem with ruby version control or any other issue?
Try to set ruby '2.2.3' in Gemfile, and execute bundle install.
If it's not resolved, please check your bundle path to execute this:
$ which bundle
/usr/bin/bundle # global
$ gem install bundler
$ bundle install --path vendor/bundle
Build job fails after updating bundler version in gemspec: https://travis-ci.org/yandex-money/yandex-money-sdk-ruby/jobs/38536867
How I can update bundler to 1.7.4 version?
Try to add the following code in an additional install section of your .travis file:
gem uninstall bundler
gem install bundler --version '1.7.4'
So, the beginning of your .travis file will be:
language: ruby
install:
- gem uninstall bundler
- gem install bundler --version '1.7.4'
script: "rake"
Add this to your .travis.yml:
before_install: gem install bundler --pre
I am trying to install the tabulous ruby gem by following this tutorial
I am getting stuck in a loop: run gem update => run gem => bundle install.
Can someone provide some information about how to proceed? I have already added the gem to Gemfile.
Here are the command outputs:
**22:16:35->gem update --system**
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.8.24
Updating RubyGems to 1.8.24
Installing RubyGems 1.8.24
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/commands/update_command.rb:153: warning: Insecure world writable dir /usr/local/git/bin/ in PATH, mode 040777
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Site/1.8/gauntlet_rubygems.rb
**22:17:33->bundle install**
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
/Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:263: warning: Insecure world writable dir /usr/local/git/bin/ in PATH, mode 040777
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.11)
Using actionpack (3.2.11)
Using sass-rails (3.2.6)
Using sqlite3 (1.3.7)
Installing tabulous (1.3.0)
Gem::InstallError: tabulous requires RubyGems version >= 1.3.7. Try 'gem update --system' to update RubyGems itself.
An error occurred while installing tabulous (1.3.0), and Bundler cannot continue.
Make sure that `gem install tabulous -v '1.3.0'` succeeds before bundling.
22:18:03->gem install tabulous -v '1.3.0
> `
> '
ERROR: While executing gem ... (ArgumentError)
Illformed requirement ["1.3.0\n`\n"]
**22:18:39->gem install tabulous -v 1.3.0**
ERROR: Error installing tabulous:
tabulous requires RubyGems version >= 1.3.7. Try 'gem update --system' to update RubyGems itself.
22:26:25->gem update --system
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.8.24
Updating RubyGems to 1.8.24
Installing RubyGems 1.8.24
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/commands/update_command.rb:153: warning: Insecure world writable dir /usr/local/git/bin/ in PATH, mode 040777
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Site/1.8/gauntlet_rubygems.rb
Try out
sudo gem update --system
Edit: I would also recommend doing as Kasumi commented and use rvm or rbenv. I had a hell of a time installing Ruby on Rails locally until I installed rbenv.