t-ruby: t unable to execute
I’m having issues with getting t to work on my High Sierra Mac I cant seem to get past this part:
/usr/local/opt/gems/gems/t-3.1.0/lib/t/cli.rb:82:in `authorize': uninitialized constant Twitter::REST::Client::BASE_URL (NameError)
$ t authorize
Welcome! Before you can use t, you'll first need to register an
application with Twitter. Just follow the steps below:
1. Sign in to the Twitter Application Management site and click
"Create New App".
2. Complete the required fields and submit the form.
Note: Your application must have a unique name.
3. Go to the Permissions tab of your application, and change the
Access setting to "Read, Write and Access direct messages".
4. Go to the Keys and Access Tokens tab to view the consumer key
and secret which you'll need to copy and paste below when
prompted.
Press [Enter] to open the Twitter Developer site.
Enter your API key: fdsfdasfdasfasdfsadfads (not real)
Enter your API secret: fdasfdsafadsfadsfadsfasddasfdas (not real)
/usr/local/opt/gems/gems/t-3.1.0/lib/t/cli.rb:82:in `authorize': uninitialized constant Twitter::REST::Client::BASE_URL (NameError)
from /usr/local/opt/gems/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /usr/local/opt/gems/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /usr/local/opt/gems/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /usr/local/opt/gems/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from /usr/local/opt/gems/gems/t-3.1.0/bin/t:20:in `<top (required)>'
from /usr/local/bin/t:23:in `load'
from /usr/local/bin/t:23:in `<main>'
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 23
Workaround for the above bug in the authorize step:
Uninstall the current t gem:
Install a previous version without this bug and do the authorize
Update t to the current version
If you have another workstation you want to use
tat, then you can copy the~/.trcfile . Although, be aware this contains your authenticated twitter identity, so this could be used to impersonate you elsewhere.+1 can confirm got the same result on High Sierra.
Quick and dirty fix mentioned elsewhere, edit the t “cli.rb” file (change the path for your ruby version):
# vi gems/ruby-2.4.1/gems/t-3.1.0/lib/t/cli.rb
Change: Twitter::REST::Client::BASE_URL To: Twitter::REST::Request::BASE_URL
I’d suggest the name of this thread be changed to reflect the error on authorization:
Fix it yourself or use one of the improved forks…
a little late to the convo but @dardo82 's script worked for me if i changed the first ’ to ’
sed -i '' 's/Client/Request/g' $(gem env | awk '/ - \//&&!/bin/{print $2}' | xargs -I @ find @ -type d -name t)/cli.rbI have the same error as OP. I’m using Ubuntu 18.04 LTS and ruby 2.5.1p57
– Brian
@dardo82’s script didn’t work for me, but manually editing the file like @marksolaris suggested worked like a charm!
Might also consider
rainbowstream: https://github.com/orakaro/rainbowstreamTwitter’s API changes this summer is gonna break a lot of the use of this utility anyway.
Background on third party APIs: http://apps-of-a-feather.com
can you link us to a good one @dardo82 ?
Issue still occurring on High Sierra. Is a permanent fix being worked on?