Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FacebookAds::Campaign.get('uid') return syntax error #56

Closed
Flexoman opened this issue Sep 19, 2018 · 8 comments
Closed

FacebookAds::Campaign.get('uid') return syntax error #56

Flexoman opened this issue Sep 19, 2018 · 8 comments

Comments

@Flexoman
Copy link

Please fix that error
ALL
api.has_param :fb:channel, 'string'
api.has_param :image:height, 'int' ....

in files
/lib/facebook_ads/ad_objects/user.rb
/lib/facebook_ads/ad_objects/group.rb

than
uninitialized constant FAMEAdCampaign
must be a FameAdCampaign
in /lib/facebook_ads/ad_objects/campaign.rb

thanks

@dianpan
Copy link

dianpan commented Sep 19, 2018

Seeing similar errors when I upgraded to v0.3.1.2

SyntaxError: /gems/facebookbusiness-0.3.1.2/lib/facebook_ads/ad_objects/user.rb:189: syntax error, unexpected ':', expecting keyword_end
        api.has_param :fb:channel, 'string'
                         ^
/gems/facebookbusiness-0.3.1.2/lib/facebook_ads/ad_objects/user.rb:189: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
...has_param :fb:channel, 'string'
...                               ^
/gems/facebookbusiness-0.3.1.2/lib/facebook_ads/ad_objects/user.rb:193: syntax error, unexpected ':', expecting keyword_end
        api.has_param :fb:explicitly_shared, 'bool'
                         ^
/gems/facebookbusiness-0.3.1.2/lib/facebook_ads/ad_objects/user.rb:193: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
...m :fb:explicitly_shared, 'bool'
...                               ^
/gems/facebookbusiness-0.3.1.2/lib/facebook_ads/ad_objects/user.rb:194: syntax error, unexpected ':', expecting keyword_end
        api.has_param :image:height, 'int'

@kerwin-personalyze
Copy link

kerwin-personalyze commented Oct 2, 2018

same here. getting the same error.

 /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:189: syntax error, unexpected ':', expecting keyword_end
               api.has_param :fb:channel, 'string'
                                 ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:189: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:193: syntax error, unexpected ':', expecting keyword_end
               api.has_param :fb:explicitly_shared, 'bool'
                                 ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:193: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:194: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:height, 'int'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:194: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:195: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:secure_url, 'string'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:195: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:196: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:type, 'string'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:196: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:197: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:url, 'string'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:197: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:198: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:user_generated, 'bool'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:198: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:199: syntax error, unexpected ':', expecting keyword_end
               api.has_param :image:width, 'int'
                                    ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:199: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:649: syntax error, unexpected ':', expecting keyword_end
               api.has_param :fb:channel, 'string'
                                 ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:649: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:653: syntax error, unexpected ':', expecting keyword_end
               api.has_param :fb:explicitly_shared, 'bool'
                                 ^
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:653: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
       /Users/*****/.rvm/rubies/ruby-2.4.4/lib/ruby/gems/2.4.0/gems/facebookbusiness-0.3.1.4/lib/facebook_ads/ad_objects/user.rb:654: syntax error, unexpected ':', expecting end-of-input
               api.has_param :image:height, 'int'

@csroberson
Copy link

Yep, same here:

2.2.3 :010 > user = FacebookAds::User.get(id)
SyntaxError: /Users/.../gems/facebookbusiness-0.3.1.5/lib/facebook_ads/ad_objects/user.rb:239: syntax error, unexpected ':', expecting keyword_end
api.has_param :fb:channel, 'string'
^

Any idea what is causing this? Seems rather fundamental.

@csroberson
Copy link

Please fix that error
ALL
api.has_param :fb:channel, 'string'
api.has_param :image:height, 'int' ....

@Flexoman, I was looking at the code and the form :fb:... is used in several places as is :image:.... I see the # FB:AUTOGEN comment in most, if not all, of the files I've examined so far; so it looks like something went wrong in generation of this version. Do you have any idea what it may be? I can see that the previous version from July 27 does not have this syntax:

19e232f

You reported this 21 days ago and I'm surprised it has not been addressed as it seems like this release is quite questionable.

in files
/lib/facebook_ads/ad_objects/user.rb
/lib/facebook_ads/ad_objects/group.rb

than
uninitialized constant FAMEAdCampaign
must be a FameAdCampaign
in /lib/facebook_ads/ad_objects/campaign.rb

FWIW, I don't see that constant, FAMEAdCampaign, in the campaign.rb file. Maybe I'm missing something.

thanks

I'm going to try reverting back a version or two.

@csroberson
Copy link

csroberson commented Oct 10, 2018

@jingping2015, @codytwinton, @vicdus, and/or @facebook-github-bot are you folks aware of this issue? All you need to do to recreate is run the example: https://github.com/facebook/facebook-ruby-business-sdk/blob/master/examples/UserAccountsEdge.rb

require 'facebook_ads'

access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<ID>'

FacebookAds.configure do |config|
  config.access_token = access_token
  config.app_secret = app_secret
end

user = FacebookAds::User.get(id)

I can reproduce this problem in 0.3.1.0 and 0.3.1.5 on a system running Ruby 2.2.3. I have to go all the way back to 0.3.0.6 for the error not to happen.

@codytwinton
Copy link
Contributor

Thanks for alerting us. We’re a small team working on the available business SDKs, but we’ll do our best to address this soon.

@jingping2015
Copy link
Contributor

Hi everyone, thanks for reporting this bug. I think we already fix this issue in our recent release, for example :

api.has_param :fb_channel, 'string'

Let me know if we miss any cases. (Please add the permalink, appreciate it!)

@joaquindiaz01
Copy link

anyone still getting same error?

An Array ({"GEM_PATH"=>["/home/joaquin/.rvm/gems/ruby-2.2.4", "/home/joaquin/.rvm/gems/ruby-2.2.4@global"]}) was passed in from bin/rails:3:in 'load' /home/joaquin/.rvm/gems/ruby-2.2.4/gems/polyglot-0.3.5/lib/polyglot.rb:65:in 'require': /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads/ad_set.rb:104: syntax error, unexpected '.' (SyntaxError) breakdowns: breakdowns&.join(','), ^ /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads/ad_set.rb:104: syntax error, unexpected ',', expecting keyword_end /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads/ad_set.rb:105: syntax error, unexpected ',', expecting keyword_end from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/polyglot-0.3.5/lib/polyglot.rb:65:in 'require' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:in 'block in require' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:240:in 'load_dependency' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/activesupport-4.2.10/lib/active_support/dependencies.rb:274:in 'require' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads.rb:12:in 'block in <top (required)>' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads.rb:12:in 'each' from /home/joaquin/.rvm/gems/ruby-2.2.4/gems/facebook_ads-0.6.6/lib/facebook_ads.rb:12:in '<top (required)>'

I only installed the gem successfully but i can't serve my application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants