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

uninitialized constant Twitter::REST #878

Open
cheater opened this Issue Nov 9, 2017 · 28 comments

Comments

Projects
None yet
@cheater

cheater commented Nov 9, 2017

Assuming this got fixed in #479 and reared its head due to some other issue now.

I literally only installed ruby 2.4, then did gem install t, and this is what happened.

Traceback:

/var/lib/gems/2.4.0/gems/t-3.1.0/lib/t/cli.rb:82:in `authorize': uninitialized constant Twitter::REST::Client::BASE_URL (NameError)
	from /var/lib/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
	from /var/lib/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
	from /var/lib/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
	from /var/lib/gems/2.4.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
	from /var/lib/gems/2.4.0/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>'

gem list says:

*** LOCAL GEMS ***

addressable (2.5.2)
bigdecimal (1.3.2, default: 1.3.0)
buftok (0.2.0)
domain_name (0.5.20170404)
equalizer (0.0.11)
geokit (1.11.0)
htmlentities (4.3.4)
http (3.0.0)
http-cookie (1.0.3)
http-form_data (2.0.0)
http_parser.rb (0.6.0)
io-console (default: 0.4.6)
json (2.1.0, default: 2.0.4)
launchy (2.4.3)
memoizable (0.4.2)
multipart-post (2.0.0)
naught (1.1.0)
oauth (0.5.3)
openssl (2.0.6, default: 2.0.5)
psych (2.2.4, default: 2.2.2)
public_suffix (3.0.1)
rdoc (5.1.0, default: 5.0.0)
retryable (2.0.4)
simple_oauth (0.3.1)
t (3.1.0)
thor (0.20.0)
thread_safe (0.3.6)
twitter (6.2.0)
unf (0.1.4)
unf_ext (0.0.7.4)

Not sure how to progress. Workarounds?

@cheater

This comment has been minimized.

Show comment
Hide comment
@cheater

cheater Nov 9, 2017

Tried this in ruby 2.1 as well, with same result.

cheater commented Nov 9, 2017

Tried this in ruby 2.1 as well, with same result.

@BlueHatbRit

This comment has been minimized.

Show comment
Hide comment
@BlueHatbRit

BlueHatbRit Nov 10, 2017

I'm getting the same issue, not quite sure what to do either. My ruby version is ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16].

It seems to be failing to find a constant in the twitter library, it's looking in Twitter::REST::Client but from what I can see in the file - https://github.com/sferik/twitter/blob/d7951759da897e6a8e3ed0069b2e850470991e3f/lib/twitter/rest/client.rb it's not there. It seems to actually be in Twitter::REST::Request I believe?

BlueHatbRit commented Nov 10, 2017

I'm getting the same issue, not quite sure what to do either. My ruby version is ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16].

It seems to be failing to find a constant in the twitter library, it's looking in Twitter::REST::Client but from what I can see in the file - https://github.com/sferik/twitter/blob/d7951759da897e6a8e3ed0069b2e850470991e3f/lib/twitter/rest/client.rb it's not there. It seems to actually be in Twitter::REST::Request I believe?

@BlueHatbRit

This comment has been minimized.

Show comment
Hide comment
@BlueHatbRit

BlueHatbRit Nov 10, 2017

Ah I see the issue - v6.1.0...v6.2.0 BASE_URL used to reside in that file but has been moved. So when Twitter 6.2.0 was released, versions of this are breaking.

Any chance someone could fix the version to 6.1.0 so this library will continue working? I'm not a huge ruby expert, you'd also need publish access.

BlueHatbRit commented Nov 10, 2017

Ah I see the issue - v6.1.0...v6.2.0 BASE_URL used to reside in that file but has been moved. So when Twitter 6.2.0 was released, versions of this are breaking.

Any chance someone could fix the version to 6.1.0 so this library will continue working? I'm not a huge ruby expert, you'd also need publish access.

@gtramontina

This comment has been minimized.

Show comment
Hide comment
@gtramontina

gtramontina Nov 14, 2017

Yeah, I guess if moving the constant out to a different location was a deliberate move, then this should be flagged as a breaking change, thus a major release should've been released. Got here from getting the same error when running a fresh install of https://github.com/sferik/t (gem install t).

I'd suggest unpublishing v6.2.0 (gem yank?) and republishing it as v7.0.0.

gtramontina commented Nov 14, 2017

Yeah, I guess if moving the constant out to a different location was a deliberate move, then this should be flagged as a breaking change, thus a major release should've been released. Got here from getting the same error when running a fresh install of https://github.com/sferik/t (gem install t).

I'd suggest unpublishing v6.2.0 (gem yank?) and republishing it as v7.0.0.

@sferik

This comment has been minimized.

Show comment
Hide comment
@sferik

sferik Nov 18, 2017

Owner

I’m working on a fix for this issue now. Sorry for the trouble.

Owner

sferik commented Nov 18, 2017

I’m working on a fix for this issue now. Sorry for the trouble.

@BlueHatbRit

This comment has been minimized.

Show comment
Hide comment
@BlueHatbRit

BlueHatbRit Nov 23, 2017

Thanks @sferik, looking forward to being able to use the CLI client 👍

BlueHatbRit commented Nov 23, 2017

Thanks @sferik, looking forward to being able to use the CLI client 👍

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 30, 2017

Thank you for working on this, waiting on it :D

ghost commented Nov 30, 2017

Thank you for working on this, waiting on it :D

@garybunofsky

This comment has been minimized.

Show comment
Hide comment
@garybunofsky

garybunofsky Dec 1, 2017

Patiently waiting for this fix as well. Thanks for working on it! 👍

garybunofsky commented Dec 1, 2017

Patiently waiting for this fix as well. Thanks for working on it! 👍

@ghamarian

This comment has been minimized.

Show comment
Hide comment
@ghamarian

ghamarian Dec 3, 2017

Also waiting :-) Thanks!

ghamarian commented Dec 3, 2017

Also waiting :-) Thanks!

@chrisvoncsefalvay

This comment has been minimized.

Show comment
Hide comment
@chrisvoncsefalvay

chrisvoncsefalvay Dec 4, 2017

Also waiting. Thanks for working on this! 👍

chrisvoncsefalvay commented Dec 4, 2017

Also waiting. Thanks for working on this! 👍

@vuiermark

This comment has been minimized.

Show comment
Hide comment
@vuiermark

vuiermark Dec 4, 2017

waiting here as well...thanks!

vuiermark commented Dec 4, 2017

waiting here as well...thanks!

@cheater

This comment has been minimized.

Show comment
Hide comment
@cheater

cheater Dec 5, 2017

OK guys i know you're impatient but this nagging absolutely has to stop. I get retarded "bump" notifications every day. This isn't goddamn twitter. Go live out your ADHD over there. The guy obviously hasn't been on github since november - look at his activity - so what are you trying to achieve with this? He's busy with his real life (yeah, some people have one) and is going to get around to it... WHEN HE GETS AROUND TO IT. Stop nagging or I'll close the bug report!

cheater commented Dec 5, 2017

OK guys i know you're impatient but this nagging absolutely has to stop. I get retarded "bump" notifications every day. This isn't goddamn twitter. Go live out your ADHD over there. The guy obviously hasn't been on github since november - look at his activity - so what are you trying to achieve with this? He's busy with his real life (yeah, some people have one) and is going to get around to it... WHEN HE GETS AROUND TO IT. Stop nagging or I'll close the bug report!

@rvagg

This comment has been minimized.

Show comment
Hide comment
@rvagg

rvagg Dec 6, 2017

Here's your workaround folks: edit /Library/Ruby/Gems/2.3.0/gems/t-3.1.0/lib/t/cli.rb, or maybe /Library/Ruby/Gems/*/gems/t-*/lib/t/cli.rb if you don't have that file. Replace the two instances of Twitter::REST::Client::BASE_URL with Twitter::REST::Request::BASE_URL and you're good to go.

rvagg commented Dec 6, 2017

Here's your workaround folks: edit /Library/Ruby/Gems/2.3.0/gems/t-3.1.0/lib/t/cli.rb, or maybe /Library/Ruby/Gems/*/gems/t-*/lib/t/cli.rb if you don't have that file. Replace the two instances of Twitter::REST::Client::BASE_URL with Twitter::REST::Request::BASE_URL and you're good to go.

@rdmarsh

This comment has been minimized.

Show comment
Hide comment
@rdmarsh

rdmarsh Dec 12, 2017

expanding on @rvagg: ubuntu 17.10, file was located at /var/lib/gems/2.3.0/gems/t-3.1.0/lib/t/cli.rb

rdmarsh commented Dec 12, 2017

expanding on @rvagg: ubuntu 17.10, file was located at /var/lib/gems/2.3.0/gems/t-3.1.0/lib/t/cli.rb

@hexwaxwing

This comment has been minimized.

Show comment
Hide comment
@hexwaxwing

hexwaxwing Dec 18, 2017

expanding on @rvagg: OS X 10.12.6 w/ rvm, file was located at ~/.rvm/gems/ruby-2.4.3/gems/t-3.1.0/lib/t/cli.rb

hexwaxwing commented Dec 18, 2017

expanding on @rvagg: OS X 10.12.6 w/ rvm, file was located at ~/.rvm/gems/ruby-2.4.3/gems/t-3.1.0/lib/t/cli.rb

@DavidCWGA

This comment has been minimized.

Show comment
Hide comment
@DavidCWGA

DavidCWGA Apr 25, 2018

rvagg's workaround doesn't work for me. The error changes to:

/var/lib/gems/2.3.0/gems/t-3.1.0/lib/t/rcfile.rb:89:in `profiles': undefined method `[]' for false:FalseClass (NoMethodError)

DavidCWGA commented Apr 25, 2018

rvagg's workaround doesn't work for me. The error changes to:

/var/lib/gems/2.3.0/gems/t-3.1.0/lib/t/rcfile.rb:89:in `profiles': undefined method `[]' for false:FalseClass (NoMethodError)
@jm3

This comment has been minimized.

Show comment
Hide comment
@jm3

jm3 May 19, 2018

@sferik would love some help getting this fixed so i can use t again!

jm3 commented May 19, 2018

@sferik would love some help getting this fixed so i can use t again!

@fuzz

This comment has been minimized.

Show comment
Hide comment
@fuzz

fuzz May 29, 2018

It's not the prettiest solution, but if anyone just wants to get this working you can do it with bundler: Make a Gemfile with gem "t" and gem "twitter", "6.1.0", call bundle install and then run it with bundle exec t

fuzz commented May 29, 2018

It's not the prettiest solution, but if anyone just wants to get this working you can do it with bundler: Make a Gemfile with gem "t" and gem "twitter", "6.1.0", call bundle install and then run it with bundle exec t

@ialexs

This comment has been minimized.

Show comment
Hide comment
@ialexs

ialexs Jun 21, 2018

Also not the prettiest solution:
I copy the .twurlrc (from Twurl https://github.com/twitter/twurl) to .trc
then run t as usual.

cheers

ialexs commented Jun 21, 2018

Also not the prettiest solution:
I copy the .twurlrc (from Twurl https://github.com/twitter/twurl) to .trc
then run t as usual.

cheers

@jasonhemann

This comment has been minimized.

Show comment
Hide comment
@jasonhemann

jasonhemann Jun 25, 2018

@fuzz or @ialexs, could either of you describe these two solutions in a little more detail?

I didn't see .twurlrc in the Twurl repo, and I don't know that I have bundle installed. I'm not familiar with that tool, and the name seems pretty Google-proof.

Thanks,

jasonhemann commented Jun 25, 2018

@fuzz or @ialexs, could either of you describe these two solutions in a little more detail?

I didn't see .twurlrc in the Twurl repo, and I don't know that I have bundle installed. I'm not familiar with that tool, and the name seems pretty Google-proof.

Thanks,

@DelphicOkami

This comment has been minimized.

Show comment
Hide comment
@DelphicOkami

DelphicOkami Jun 29, 2018

@jasonhemann

  1. Go to https://apps.twitter.com/
  2. Ensure your app (whether newly created or otherwise) has Read, Write and Access direct messages permissions
  3. Locally run gem install twurl
  4. Run twurl authorize --consumer-key {YOUR APP'S CONSUMER KEY} --consumer-secret {YOUR APP'S CONSUMER SECRET}
  5. Follow the steps it requests that you do
  6. Copy ~/.twurlr to ~/.trc

Essentially what @ialexs seems to mean is, copy the file generated by twurl

DelphicOkami commented Jun 29, 2018

@jasonhemann

  1. Go to https://apps.twitter.com/
  2. Ensure your app (whether newly created or otherwise) has Read, Write and Access direct messages permissions
  3. Locally run gem install twurl
  4. Run twurl authorize --consumer-key {YOUR APP'S CONSUMER KEY} --consumer-secret {YOUR APP'S CONSUMER SECRET}
  5. Follow the steps it requests that you do
  6. Copy ~/.twurlr to ~/.trc

Essentially what @ialexs seems to mean is, copy the file generated by twurl

@DelphicOkami

This comment has been minimized.

Show comment
Hide comment
@DelphicOkami

DelphicOkami Jun 29, 2018

The above totally worked for me

DelphicOkami commented Jun 29, 2018

The above totally worked for me

@cooperkernan

This comment has been minimized.

Show comment
Hide comment
@cooperkernan

cooperkernan Jul 11, 2018

Ah editing the cli.rb worked fine! Didn't realize there were two instances. Many thanks.

cooperkernan commented Jul 11, 2018

Ah editing the cli.rb worked fine! Didn't realize there were two instances. Many thanks.

@kylejohnston

This comment has been minimized.

Show comment
Hide comment
@kylejohnston

kylejohnston Jul 14, 2018

The path to my cli.rb file was listed in the error message output after I entered my API keys (my path was different from the paths listed above).

Once I edited both instances of Twitter::REST::Request::BASE_URL, the installation completed.

kylejohnston commented Jul 14, 2018

The path to my cli.rb file was listed in the error message output after I entered my API keys (my path was different from the paths listed above).

Once I edited both instances of Twitter::REST::Request::BASE_URL, the installation completed.

@albill

This comment has been minimized.

Show comment
Hide comment
@albill

albill Jul 19, 2018

Really, this has been broken for eight months without a fix? WTH?

albill commented Jul 19, 2018

Really, this has been broken for eight months without a fix? WTH?

@eobrain

This comment has been minimized.

Show comment
Hide comment
@eobrain

eobrain Jul 23, 2018

Let's be nice here. This is a 12-year old open-source project. It is not unreasonable that the original maintainer might not jump in and fix bugs after all that time.

Anyone with Ruby skills and sufficient interest could contribute a fix. (I myself actually spent a little while freshening my rusty Ruby skills to see if I could fix this issue, but I just have not had time to devote to it.)

166 people have contributed to this repo over the years, so I suspect there are multiple people out there who would be able and willing to fix this.

eobrain commented Jul 23, 2018

Let's be nice here. This is a 12-year old open-source project. It is not unreasonable that the original maintainer might not jump in and fix bugs after all that time.

Anyone with Ruby skills and sufficient interest could contribute a fix. (I myself actually spent a little while freshening my rusty Ruby skills to see if I could fix this issue, but I just have not had time to devote to it.)

166 people have contributed to this repo over the years, so I suspect there are multiple people out there who would be able and willing to fix this.

@jm3

This comment has been minimized.

Show comment
Hide comment
@jm3

jm3 Jul 24, 2018

@eobrain any suggestions for how best to appeal to some of those people?

jm3 commented Jul 24, 2018

@eobrain any suggestions for how best to appeal to some of those people?

@kennethreitz

This comment has been minimized.

Show comment
Hide comment
@kennethreitz

kennethreitz Aug 29, 2018

For those just running into this issue (like myself), this solution worked for me.

kennethreitz commented Aug 29, 2018

For those just running into this issue (like myself), this solution worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment