Reputation: 197
I have a question similar to the one in this post, however the answers there were not working for me.
Was attempting to update my Heroku app and received the following message:
remote: Using rake 11.1.0
...
Bundle complete! 17 Gemfile dependencies, 55 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (0.40s)
remote: Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: rake aborted!
remote: FlickRaw::FlickrAppNotConfigured: No API key or secret defined!
remote: /tmp/build_da0b10dd4509bfcc0a788669177fe992/vendor/bundle/ruby/2.2.0/gems/flickraw-0.9.8/lib/flickraw/api.rb:41:in `initialize'
remote: /tmp/build_da0b10dd4509bfcc0a788669177fe992/vendor/bundle/ruby/2.2.0/gems/flickraw-0.9.8/lib/flickraw.rb:20:in `new'
remote: /tmp/build_da0b10dd4509bfcc0a788669177fe992/vendor/bundle/ruby/2.2.0/gems/flickraw-0.9.8/lib/flickraw.rb:20:in `flickr'
...
I'm pretty certain this relates to the line No API key or secret defined!
but I've declared the Flickraw api key and secret in /config/initializers/01_keys.rb
.
If needed, here are the contents of that file. I've stored the environment variables in a hidden file using the figaro gem:
require 'flickraw'
FlickRaw.api_key = ENV['API_KEY']
FlickRaw.shared_secret = ENV['SHARED_SECRET']
token = flickr.get_request_token
auth_url = flickr.get_authorize_url(token['oauth_token'], :perms => 'delete')
puts "Open this url in your process to complete the authication process : #{auth_url}"
puts "Copy here the number given when you complete the process."
verify = gets.strip
begin
flickr.get_access_token(token['oauth_token'], token['oauth_token_secret'], verify)
login = flickr.test.login
puts "You are now authenticated as #{login.username} with token #{flickr.access_token} and secret #{flickr.access_secret}"
rescue FlickRaw::FailedResponse => e
puts "Authentication failed : #{e.msg}"
end
Upvotes: 0
Views: 85
Reputation: 689
If the line says "No API key or secret defined!" I'd start looking there because flickraw is definitely throwing an error because of it. Make sure those ENV variables are working properly with a puts statement or something.
Upvotes: 1