twurl
twurl copied to clipboard
After install all I get is twurl: command not found
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):
- OS: Xubuntu 20.04 (essentially same as Ubuntu 20.04, different UI is all)
- Browser N/A
- Version Ruby gems 3.1.4, and twurl 0.9.6
Additional context I also tried installing from source:
$ git clone https://github.com/twitter/twurl
$ cd twurl
$ bundle install
and got the same result.
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.
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?
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.
+1 same issue, tried MacOS and Ubuntu
UPDATE: actually works in an Ubuntu container now
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.