twitter / twurl

OAuth-enabled curl for the Twitter API
https://developer.twitter.com
MIT License
1.8k stars 301 forks source link

After install all I get is twurl: command not found #156

Open RogerParkinson opened 4 years ago

RogerParkinson commented 4 years ago

Describe the bug I followed the instructions in install.md ie gem install twurl and I see:

Successfully installed twurl-0.9.6
Parsing documentation for twurl-0.9.6
Done installing documentation for twurl after 0 seconds
1 gem installed

Then twurl -v to verify it is working:

twurl: command not found

To Reproduce I'm using Xubuntu 20.04, fairly new install so a fresh install of ruby was required. This is the output of my sudo gem env command:

RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.4
  - RUBY VERSION: 2.7.2 (2020-10-01 patchlevel 137) [x86_64-linux]
  - INSTALLATION DIRECTORY: /root/.gem
  - USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /snap/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /root/.gem/bin
  - SPEC CACHE DIRECTORY: /root/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: //etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /root/.gem
     - /snap/ruby/189/lib/ruby/gems/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/sbin
     - /usr/local/bin
     - /usr/sbin
     - /usr/bin
     - /sbin
     - /bin
     - /snap/bin

Expected behavior I expected my twurl -v command to print a twurl version

Desktop (please complete the following information):

Additional context I also tried installing from source:

$ git clone https://github.com/twitter/twurl
$ cd twurl
$ bundle install

and got the same result.

andypiper commented 4 years ago

Have you installed the gem as root, or as your regular user? I'd expect the install to have put a link to twurl into your Rubygems PATH, which I'd expect to be on your logged-in user's PATH. Try echo $PATH to check the current value.

RogerParkinson commented 4 years ago

echo $PATH /usr/local/maven/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/git-bug:/opt/terraform

(I can't see any reference to ruby on there)

To install ruby I used sudo snap install ruby --classic Then (as per the install.md file and as I said in the op) I installed twurl using gem install twurl what should I have done different?

andypiper commented 4 years ago

Looking at this Ask Ubuntu thread, it looks like you need to have .gem/bin on your PATH. I haven't tested on Ubuntu for a while. There's more information here about how you could configure this for a snap.

MaxHorstmann commented 3 years ago

+1 same issue, tried MacOS and Ubuntu

UPDATE: actually works in an Ubuntu container now

mcintyre94 commented 3 years ago

I installed Ruby in MacOS using Brew, needed to do echo 'export PATH="/usr/local/lib/ruby/gems/3.0.0/bin:$PATH"' >> ~/.zshrc to get gems on my path.