Skip to content

Instantly share code, notes, and snippets.

@pnlybubbles
Last active December 15, 2015 17:58
Show Gist options
  • Save pnlybubbles/5299887 to your computer and use it in GitHub Desktop.
Save pnlybubbles/5299887 to your computer and use it in GitHub Desktop.
MacRubyでTwitter gemうまく動かないメモ。(MacRuby 0.12 (ruby 1.9.2) [universal-darwin10.0, x86_64], macgem 1.8.20, twitter gem (4.6.2))
#
# AppDelegate.rb
# TwitterGemTest
#
# Created by あわあわ on 13/04/03.
# Copyright 2013年 あわあわ. All rights reserved.
#
require "rubygems"
require "twitter"
CONSUMER_KEY = "*"
CONSUMER_SECRET = "*"
ACCESS_TOKEN = "*"
ACCESS_TOKEN_SECRET = "*"
class AppDelegate
attr_accessor :window, :textfield
def applicationDidFinishLaunching(a_notification)
Twitter.configure do |config|
config.consumer_key = CONSUMER_KEY
config.consumer_secret = CONSUMER_SECRET
end
@twitter = Twitter::Client.new(
:oauth_token => ACCESS_TOKEN,
:oauth_token_secret => ACCESS_TOKEN_SECRET
)
end
def post(sender)
@twitter.update(textfield.stringValue)
end
end
/Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/base.rb:11:in `block': wrong number of arguments (1 for 0) (ArgumentError)
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/base.rb:10:in `block'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/base.rb:9:in `attr_reader'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action/tweet.rb:8:in `block'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action/tweet.rb:6:in `block'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action/tweet.rb:5:in `block'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action/tweet.rb:4:in `<main>'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action/favorite.rb:1:in `<main>'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter/action_factory.rb:1:in `<main>'
from /Library/Ruby/Gems/MacRuby/0.12/gems/twitter-4.6.2/lib/twitter.rb:1:in `<main>'
from /Users/pnlybubbles/Library/Developer/Xcode/DerivedData/TwitterGemTest-aigfhpiawvronobwimynerbioxem/Build/Products/Debug/TwitterGemTest.app/Contents/Resources/AppDelegate.rb:10:in `<main>'
from /Users/pnlybubbles/Library/Developer/Xcode/DerivedData/TwitterGemTest-aigfhpiawvronobwimynerbioxem/Build/Products/Debug/TwitterGemTest.app/Contents/Resources/rb_main.rb:18:in `block'
from /Users/pnlybubbles/Library/Developer/Xcode/DerivedData/TwitterGemTest-aigfhpiawvronobwimynerbioxem/Build/Products/Debug/TwitterGemTest.app/Contents/Resources/rb_main.rb:16:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment