google-api-ruby-client: cannot load such file -- google/api_client/client_secrets

For a Rails 3.2.2 project, I got this error: LoadError (cannot load such file – google/api_client/client_secrets): app/controllers/subscriptions_controller.rb:2:in <top (required)>' lib/flash_session_cookie_middleware.rb:17:incall’

I also doing the same configuration on another Rails 4 project, and everything works fine.

P/S: It’s not related to this issue: https://github.com/google/google-api-ruby-client/issues/123

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 17 (3 by maintainers)

Commits related to this issue

Most upvoted comments

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.

@karthickibz require => 'google/apis'

I had the same issue here, I had to revert back to 0.8.2 and add this to my Gemfile…

gem 'google-api-client', '0.8.2', require: 'google/api_client'

@PurityMaina The path you are specifying to require does not exist, which is why you are getting a LoadError. Bundler can be configured to auto-load dependencies, and it uses the gem’s name to guess at how to load the gem. There are two solutions. First, you can disable the auto-loading of the gem in your Gemfile, and let whatever dependency is using google-api-client require it:

gem 'google-api-client', require: false

Second, you can specify a path that does exist in your Gemfile for Bundler to auto-load. The path I would use is 'google/apis':

gem 'google-api-client', require: 'google/apis'

Either of these approaches will allow you to use an up-to-date version of google-api-client in your app.

gem 'google-api-client', '0.24.3', require: 'google/apis'

i had ‘google-api-client’, ‘0.9’ installed changing it to ‘0.8.2’ did it for me

Worked for me too.