I'm using Arch Linux with Zsh.
I installed RVM follow the official document :
$ curl -L https://get.rvm.io | bash -s stable --ruby
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.zshrc
$ source ~/.zshrc
$ rvm use 1.9.2 --default
After installed RVM. Every gem I installed show me the Gem::LoadError error like this :
$ gem install huami
$ huami
/home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find huami (>= 0) amongst [] (Gem::LoadError)
from /home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /home/meck/.gem/ruby/1.9.1/bin/huami:22:in `<main>'
And gem list is empty :
$ gem list
*** LOCAL GEMS ***
This is my gem env :
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.2 (2012-04-20 patchlevel 320) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/meck/.rvm/gems/ruby-1.9.2-p320#global
- RUBY EXECUTABLE: /home/meck/.rvm/rubies/ruby-1.9.2-p320/bin/ruby
- EXECUTABLE DIRECTORY: /home/meck/.rvm/gems/ruby-1.9.2-p320#global/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/meck/.rvm/gems/ruby-1.9.2-p320#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://rubygems.org/"]
- "gem" => "--user-install"
- REMOTE SOURCES:
- http://rubygems.org/
Could anybody point out what step did I miss?
RVM doesn't work very will with oh-my-zsh. oh-my-zsh likes to control a lot of your shell experience. Your mileage will vary. Certain extensions will conflict with RVM's operation. Hop in IRC Freenode #rvm if you encounter issues as they can provide direct and quick help with oh-my-zsh.
Related
I'm trying to install cocoapods on Mac
Successfully installed cocoapods-0.25.0
1 gem installed
But
$ pod install
-bash: pod: command not found
Ruby was installed using brew
$ which ruby
/usr/local/bin/ruby
$ which gem
/usr/local/bin/gem
Here is output of gem environment
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin12.5.0]
- INSTALLATION DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
- RUBY EXECUTABLE: /usr/local/Cellar/ruby/2.0.0-p247/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/Cellar/ruby/2.0.0-p247/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /usr/local/Cellar/ruby/2.0.0-p247/lib/ruby/gems/2.0.0
- /Users/nt/.gem/ruby/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- https://rubygems.org/
What I should export or add to .bash_profile to get pod install working?
If you are using rbenv like I am, after installing a gem you have to run rbenv rehash to get a link in the shims directory.
My bad, this line in .bash_profile helped
export PATH=$PATH:/usr/local/Cellar/ruby/2.0.0-p247/bin
I searched through similar questions, but still could not solve this problem. I installed my jiveapps gem, but then it cannot be found.
Successfully installed jiveapps-1.0.7
1 gem installed
Installing ri documentation for jiveapps-1.0.7...
Installing RDoc documentation for jiveapps-1.0.7...
new-host-2:sites jeffreyerickatz$ gem list jiveapps
*** LOCAL GEMS ***
The following also did not work:
new-host-2:sites jeffreyerickatz$ gem which jiveapps
ERROR: Can't find ruby library file or shared library jiveapps
new-host-2:sites jeffreyerickatz$ rake gemspec
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace)
You can see that I only have one version of ruby installed
ew-host-2:sites jeffreyerickatz$ rvm list
rvm rubies
=* ruby-1.9.3-p194 [ x86_64 ]
# => - current
# =* - current && default
# * - default
and here are my gem paths
- GEM PATHS:
- /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1
- /Users/jeffreyerickatz/.gem/ruby/1.9.1
and when I do sudo gem environment I get
sudo gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [x86_64-darwin11.4.2]
- INSTALLATION DIRECTORY: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3- p194/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
- EXECUTABLE DIRECTORY: /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/gems/1.9.1
- /Users/jeffreyerickatz/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
gem path
new-host-2:Desktop jeffreyerickatz$ echo $GEM_HOME
/Users/jeffreyerickatz/.rvm/gems/ruby-1.9.3-p194
If you copied pasted that correctly, it looks like gems are being installed into "/Users/jeffreyerickatz/.rvm/rubies/ruby-1.9.3- p194/lib/ruby/gems/1.9.1" (note the space between 1.9.3- and p194).
You can further check by echo $GEM_HOME. $GEM_HOME should be set to your gem path.
I've decided to move away from rvm to rbenv on my personal machine. Followed the rvm removal instructions, installed rbenv and everything looks peachy. After restarting my shell session:
$ rbenv global
1.9.3-p0
$ ls .rvm
ls: cannot access .rvm: No such file or directory
$ rbenv exec gem list
*** LOCAL GEMS ***
A completely fresh install in a fresh shell--RVM's long gone. Now, when I install bundler
$ rbenv exec gem install bundler
Fetching: bundler-1.0.22.gem (100%)
Successfully installed bundler-1.0.22
1 gem installed
$ rbenv rehash
$ echo $?
0
$ rbenv which bundle
rbenv: bundle: command not found
What? Indeed, look at this nonsense:
$ ls .rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.22/
bin bundler.gemspec CHANGELOG.md ISSUES.md lib LICENSE man Rakefile README.md spec UPGRADING.md
Somehow, someway, RVM still has its hooks into me. My ~/.bash* files are clean and
$ cat ~/.gemrc
gem: --no-ri --no-rdoc
I have no system ruby, no globally installed RVM (nothing in /etc/profile/, no /etc/profile.d/rvm.sh and nothing in /etc/bash.bashrc) and I'm at a complete loss.
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /home/blt/.rvm/gems/ruby-1.9.3-p0
- RUBY EXECUTABLE: /home/blt/.rbenv/versions/1.9.3-p0/bin/ruby
- EXECUTABLE DIRECTORY: /home/blt/.rvm/gems/ruby-1.9.3-p0/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/blt/.rvm/gems/ruby-1.9.3-p0
- /home/blt/.rvm/gems/ruby-1.9.3-p0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://rubygems.org/
Where else can I look to figure out why gem's configured to install to ~/.rvm?
Something's clearly rotten on my system; no grepping has turned it up, but tacking
unset GEM_HOME
unset GEM_PATH
to the end of my ~/.bashrc made things sane. Horrible hack, though.
Have you ever installed rvm in a system location? Maybe those env vars got into a system-wide shell config.
Try running:
bash -l -x -c 'echo'
This will print bash debugging output so you can see what files are being loaded. It may not show commands inside sourced scripts, depending on your version of bash.
This probably doesn't apply to you, but if it exists, what are the contents of ~/.gemrc ?
➜ ~ cloudapp Desktop/test.txt
You need to install cloudapp_api: gem install cloudapp_api
➜ ~ sudo gem install cloudapp_api
Password:
Successfully installed cloudapp_api-0.3.1
1 gem installed
Installing ri documentation for cloudapp_api-0.3.1...
Installing RDoc documentation for cloudapp_api-0.3.1...
➜ ~ cloudapp ~/Desktop/test.txt
You need to install cloudapp_api: gem install cloudapp_api
➜ ~ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.5
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/bkern/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
➜ ~
➜ ~ which ruby
/usr/bin/ruby
~ ls -ls /usr/bin/ruby
8 lrwxr-xr-x 1 root wheel 76 Mar 23 10:16 /usr/bin/ruby -> ../../System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
➜ ~ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
I am not sure how to resolve this. Any help would be appreciated. I am running snow leopard.
Gem.all_load_paths.grep /cloudapp/
NOTE: Gem.all_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_load_paths called from (irb):7.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Library/Ruby/Site/1.8/rubygems.rb:260.
NoMethodError: undefined method specifications' for "/Library/Ruby/Gems/1.8":String
from /Library/Ruby/Site/1.8/rubygems.rb:425:ineach_load_path'
from /Library/Ruby/Site/1.8/rubygems.rb:423:in each'
from /Library/Ruby/Site/1.8/rubygems.rb:423:ineach_load_path'
from /Library/Ruby/Site/1.8/rubygems.rb:260:in _deprecated_all_load_paths'
from /Library/Ruby/Site/1.8/rubygems.rb:259:ineach'
from /Library/Ruby/Site/1.8/rubygems.rb:259:in _deprecated_all_load_paths'
from /Library/Ruby/Site/1.8/rubygems/deprecate.rb:62:insend'
from /Library/Ruby/Site/1.8/rubygems/deprecate.rb:62:in `all_load_paths'
from (irb):7
The cloudapp binary is very simple..it begins like this:
require 'rubygems'
begin
require 'cloudapp_api'
rescue LoadError
puts "You need to install cloudapp_api: gem install cloudapp_api"
exit!(1)
end
Here's what I would do:
"Make sure you have it plugged in fix": reinstall cloudapp (not the api, just the app).
In a clean irb (start with irb -f). Can you require cloudapp_api there (remember to require rubygems first)?
Check the bang-line (the first line) of the cloudapp binary (use which cloudapp to locate it). Is it running under the correct ruby binary?
These are the first steps of troubleshooting..let's see what you get..
I was having some trouble running some Ruby scripts. While trying to get these scripts to run I tried lots of different things as well as updating rubygems as I thought this may be the problem. Since then I can't get any Ruby scripts to run.
I think that if I can revert rubygems back to it's original version I may be able to run Ruby scripts again, but I don't know how.
$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/ryan/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
$ ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10]
$ which -a ruby
/opt/local/bin/ruby
/opt/local/bin/ruby
/usr/bin/ruby
/usr/local/bin/ruby
$ which -a gem
/usr/bin/gem
/usr/local/bin/gem
Thank you for any help in advance.
Ryan
$ ruby spidr_start_at.rb
spidr_start_at.rb:1:in `require': no such file to load -- rubygems (LoadError)
from spidr_start_at.rb:1
$ cat spidr_start_at.rb
require 'rubygems'
require 'uri'
require 'spidr'
url = 'http://www.ethicalhack3r.co.uk'
puts "Spidr.start_at()"
puts
Spidr.start_at(url, :depth => 1) do |spider|
spider.every_page do |page|
puts page.url.to_s
end
end
It seems that you have multiple versions of ruby(and gem) installed. It is advised to use rvm when maintaining multiple ruby versions. Or clean up your wrong/old/unneeded installations.
For downgrading Rubygems, you can do the following:
sudo gem update --system VERSION
You obviously have to put a real version there.