C.J. Coffey
C.J. Coffey

Reputation: 60

cannot load such file -- google/apis/sheets_v4 (LoadError)

I'm writing an app that accesses and edits google sheets. I have the same code working in a ruby test file, but when I copy the code line for line to the rails model it throws an error: cannot load such file -- google/apis/sheets_v4 (LoadError)

I have made sure to require google/apis/sheets_v4 and that I'm up to date on 'google-api-client' Both of my files are in the same folder, so they should have access to the same libraries.

The only potential source of error that I have so far is that some part of the app relies on a legacy version of google-api-client, so both 0.4.7 and 0.23.3 are installed. Is there a way to force utilization of one over the other?

The app was developed before my arrival at the company, so I don't know the reasoning for the use of a legacy api (yet).

Upvotes: 1

Views: 2061

Answers (1)

ReyAnthonyRenacia
ReyAnthonyRenacia

Reputation: 17651

Try the solution from this github forum to use the version you want:

I had to do

gem 'google-api-client', '~> 0.7.1'

then bundle update google-api-client addressable faraday and that let me figure out which other gems to update for me to be able to use that newer gem version. Because of dependencies by default bundle was installing older version for me.

Upvotes: 1

Related Questions