Ruby Gems returns command not found
Your $PATH
variable needs to include the exact path to your Ruby's bin directory. Adding a directory to the PATH
does not include it's subfolders. Try adding the bin directory via:
export PATH=$PATH:/home/adam/.gem/ruby/1.8/bin
or if you installed the gem using sudo
:
export PATH=$PATH:/usr/lib/ruby/gems/1.8/bin
You might want to add this to your .bashrc
file, so that you don't have to set this manually every time your open up a new bash.
Gem installed but 'command not found'
So you're working with rbenv
. According to its README, you should run rbenv rehash
after installing any gems that have an executable command. Also, run it anytime you install a new Ruby version.
Gem Command not found
Are you wanting ruby gems? If so, you need to install libgemplugin-ruby and then the ruby 'gem' program will be in your path:
aptitude install libgemplugin-ruby
Ruby works, but gem command not found - via SSH
RubyGems is in standard installation since 1.9.x so you need to install RubyGems or use RVM or rbenv to use newer version.
Rails command not available after installing with gemfile
So, I was running rbenv rehash
and setting the environment variable. However, the new env variables were not available until after a restart. Using the full path to /.rbenv/shims/rake
solved the problem.
Can't execute installed gem `erb2slim` using rbenv
Please try the alternative provided by html2slim:
https://rubygems.org/gems/html2slim/versions/0.2.0
This should provide a erb2slim
executable as well as an html2slim
executable
Command 'rbenv' not found, but can be installed with
Well in the github repo I can't seem to find the method/script you are using to install.
just use the complete manual approach as specified on the website as of today.
remove every rbenv related line first from your ~/.bashrc
, and rm -rf ~/.rbenv
then just copy-paste the below lines.
git clone https://github.com/rbenv/rbenv.git ~/.rbenv --depth=1 #shallow clone cuz ig u just want to use it
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
should work just fine, + you get the additional benefit of getting the latest version. whenever you wish to update just cd ~/.rbenv && git pull
comment if still issues.
Related Topics
How to Make a Post Request with Open-Uri
Generating an Instagram- or Youtube-Like Unguessable String Id in Ruby/Activerecord
Detect Key Press (Non-Blocking) W/O Getc/Gets in Ruby
Converting from Xml Name-Values into Simple Hash
Finding If a Sentence Contains a Specific Phrase in Ruby
What Does "<Top (Required)>" Mean in a Ruby Stack Trace
Ruby: Inject Issue When Turning Array into Hash
How to Elegantly Rename All Keys in a Hash in Ruby
Ruby Metaprogramming: Dynamic Instance Variable Names
Linkedin API for Company Directory
Chaining Methods Using Symbol#To_Proc Shorthand in Ruby
Is There an Equivalent Null Prevention on Chained Attributes of Groovy in Ruby