Reputation: 105
I installed the google places gem on Rails. When I try to set up the @client = GooglePlaces::Client.new(API_KEY)
I get several errors.
I entered my API key and replaced client
with restaurant
. I tried running this in the folder and I get a syntax error.
When I tried to run the same thing in console, I get the following error:
NameError (uninitialized constant here)
Can anyone let me know what is going on?
Upvotes: 0
Views: 60
Reputation: 30056
You're passing the API key like if it was defined somehow, but it's not. That should be a string
@client = GooglePlaces::Client.new("your api key") # between quotes
or using a variable
api_key = "your api key"
@client = GooglePlaces::Client.new(api_key)
Upvotes: 1