Error while running bundle install: bundle is locked to a parser - bundle

I just cloned a new repo and tried to run bundle install but getting following error
Fetching gem metadata from https://abcderepos.net/api/gems/rubygems/...........
Your bundle is locked to parser (2.5.0.4), but that version could not be found in any of the sources listed in your Gemfile. If
you haven't changed sources, that means the author of parser (2.5.0.4) has removed it. You'll need to update your bundle to a
different version of parser (2.5.0.4) that hasn't been removed in order to install.
Any idea why i am getting this error?

Looks like parser version 2.5.0.4 was pulled from rubygems. I ran into the same issue today as well. You will either need to update your parser version to 2.5.0.5 or downgrade to 2.5.0.3.
UPDATE: They have documentation here to support why it was removed

The solution is bundle update parser --patch. (Do not change Gemfile.lock manually.)

Related

Why does changing Bundlers installation directory cause Sorbet to fall over?

For reasons to do with my CI setup I've needed to change the location where I install my Ruby gems from the default location to: bundle config set path 'vendor/bundle'
However, as soon as I do so, Sorbet loses it's cool and throws out over 6,000 errors. Why would Sorbet be so sensitively dependent on where the gem is installed? (I clear all of the gems before switching location so it's very unlikely to be due to a clash of gem versions).
Summary
When gems are installed to:
/Users/my-home-directory/.rbenv/versions/2.7.5/lib/ruby/gems/2.7.0/gems
bundle exec srb tc works fine. But when gems are installed to:
/Users/my-home-directory/project-name/vendor/bundle/ruby/2.7.0/gems/
then running bundle exec srb tc generates thousands of errors.
By default, Sorbet attempts to typecheck the entire directory under project-name. Try adding the following line to sorbet/config:
--ignore=/vendor/bundle
(This should be automatically included in newer installs of sorbet that incorporate https://github.com/sorbet/sorbet/pull/3897 )

IMPORTANT: Remember to use the included executable `certifed-update` regularly to keep your certificate bundle up to date

$ gem install bundler
gives me (at the end of the successful install):
Post-install message from certified:
IMPORTANT: Remember to use the included executable `certifed-update` regularly to keep your certificate bundle up to date.
I can't see how I'm going to remember to keep this executable indefinitely up to date. Any suggestions?
There is a typo in the message: certifed-update does not exist, it's certified-update (notice the missing "i"). It's strange as this typo is fixed in latest gem code (maybe the author forgot to publish a new version, who knows)
You can run this tool manually with:
bundle exec certified-update
Which yields this message:
Updating ca-bundle from
https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt
Certificate bundle updated. Remember to do this regularly!
In order to remember to update the certificates you can configure a periodic reminder in your calendar, or you can setup a cron job or similar to make it automatically ;-)
It seems you're using this gem and it's getting run somehow after gem install bundler. Try deleting it via gem uninstall certified and rerun gem install bundler.

Jekyll and Redcarpet (plus dependencies)

Up until a few hours ago, I had my jekyll install working as normal. Having created 26 different posts using my current setup, I'm not expecting something to suddenly not work at all. Ran jekyll build to see the results of a new post I created for my blog. I got an error saying it could not find redcarpet; weird since I have never touched my config or anything since I created it. I ran bundle install no new gems added. For sanity's sake I ran bundle show redcarpet, it could not be found. Okay that's weird. So I run gem install redcarpet v 3.1.0 which was the version I was using pretty much the entire time. I then run bundle install again, checking to see if redcarpet was added...and nope.
I decided to go into my config and switch markdown parser and add kramdown, then run jekyll serve...and now I get that I'm missing kramdown and like redcarpet even if I install via gem install jekyll refuses to acknowledge it's existence.
I tried deleting my gemfile and rebuilding it unfortunately that does nothing. If I run bundle exec jekyll serve it works however redcarpet isn't activated and thus the markdown isn't parsed correctly (And new entries aren't added to the index page).
I'm probably missing something obvious, any direction or advice would be much appreciated.

Tool google-api from google-api-client not working

I want to make a short tool that has to have access to my Google Calendar. Therefore I have to use the google-api-client gem. When I take a look to the gems installed I see it.
Before I can use the classes and methods made available with this, I have to create a YAML file with my clientID and clientSecret and a few other things. Therefore, the gem should have a cli tool called "google-api". If I now want to create this file, I always get the message google-api: command not found.
I use rvm if this is important. But I've checked if I have the right gemset availible.
(Everything I have to do, I found here: https://developers.google.com/google-apps/calendar/instantiate?hl=de)
I have got the same problems.
What version did you installed google-api-client gem ? I think you may have installed latest version.
It removed the bin file from version 0.7.0.(see here: https://github.com/google/google-api-ruby-client/blob/master/CHANGELOG.md#070)
If you need the command, reinstall with this command :"gem uninstall google-api-client; gem install google-api-client -v 0.6.4".

How to develop a gem in staging environment?

I am trying to hack through a forked gem (buildr). As such I cloned it from github and began to butcher the code. The official gem is installed on my system (under /usr/lib/ruby.../gems/buildr...). There is an executable which I need to use in my dev process - buildr.
Now I want the buildr executable and the library to point to my forked repo and not the default gem installation. This would be for this gem only. As such, the changes I make against the forked repo is usable directly for testing and so forth.
I would guess I need to load my library prior to the system gem loading. Can somebody recommend the best way to do so?
I did something similar for work when the Spreadsheet gem broke backward compatibility. I put the previous versions code in it's own module and just renamed the gem my-spreadsheet and installed that (I really wanted some of the features of the new gem but I also didn't want to rewrite all my previous code at that point).
If it's just a binary you want to override you could always do some PATH magic, setting the directory of your binary first and thus make sure you always override. But personally I'd prefer making my own copy with a new name and installing that.
you could bump the version in the gemspec for your fork. Then when you install your version of the gem, it will use your (newer) version by default.
change buildr.gemspec
#...
spec.version = '1.3.4.dev'
#...
Then
$ gem build buildr.gemspec
$ sudo gem install buildr-1.3.4.dev.gem
and it should work.

Resources