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:in
call’
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
- changed google-api-lclient to 0.8.2 because of https://github.com/google/google-api-ruby-client/issues/132 — committed to BenMatheja/google-directory by BenMatheja 8 years ago
- fix rais 3.2.2 LoadError (cannot load such file -- google/api_client it will fix similar issue to https://github.com/google/google-api-ruby-client/issues/132 — committed to pablodav/redmine-marcel by pablodav 7 years ago
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…
@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:
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'
:Either of these approaches will allow you to use an up-to-date version of google-api-client in your app.
Worked for me too.