I have ruby 2.2.0 and I use RVM for a project that requires 2.0.0
After installing RVM I tried to use sass or compass gems outside the project and got this:
$ compass watch
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'compass' (>= 0) among 49 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /usr/bin/compass:22:in `<main>'
I tried removing RVM and reinstalling the gems and all worked fine, but I need it for the project.
Why is it looking in 2.0 folder? When I do rvm info I get ruby-2.2.0:
Update:
$ which ruby
/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby
$ which compass
/usr/bin/compass
$rvm info
ruby-2.2.0:
system:
uname: "Darwin ilyo-audyx.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
zsh: "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
rvm:
version: "rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "4 days 7 hours 57 minutes 33 seconds ago"
path: "/Users/ilyo/.rvm"
ruby:
interpreter: "ruby"
version: "2.2.0p0"
date: "2014-12-25"
platform: "x86_64-darwin14"
patchlevel: "2014-12-25 revision 49005"
full_version: "ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]"
homes:
gem: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
binaries:
ruby: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/ruby"
irb: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/irb"
gem: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/gem"
rake: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin/rake"
environment:
PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0/bin:/Users/ilyo/.rvm/gems/ruby-2.2.0#global/bin:/Users/ilyo/.rvm/rubies/ruby-2.2.0/bin:/Users/ilyo/.rvm/bin:/usr/local/bin:/Users/ilyo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
GEM_HOME: "/Users/ilyo/.rvm/gems/ruby-2.2.0"
GEM_PATH: "/Users/ilyo/.rvm/gems/ruby-2.2.0:/Users/ilyo/.rvm/gems/ruby-2.2.0#global"
MY_RUBY_HOME: "/Users/ilyo/.rvm/rubies/ruby-2.2.0"
IRBRC: "/Users/ilyo/.rvm/rubies/ruby-2.2.0/.irbrc"
RUBYOPT: ""
gemset: ""
Related
Is this because of the empty GEM_HOME variable on Environment?
I couldn't figure it out for hours..
➜ ~ gem install mysql
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory -
➜ ~ mysql --version
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper
➜ ~ gem install mysql2
Fetching: mysql2-0.4.2.gem (100%)
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory -
➜ ~ rvm info
system:
system:
uname: "Darwin Seos-MacBook.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64"
system: "osx/10.11/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin15)"
zsh: "/bin/zsh => zsh 5.0.8 (x86_64-apple-darwin15.0)"
rvm:
version: "rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "21 minutes 30 seconds ago"
path: "/Users/seoyoochan/.rvm"
homes:
gem: "not set"
ruby: "not set"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/Users/seoyoochan/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin"
GEM_HOME: ""
GEM_PATH: ""
MY_RUBY_HOME: ""
IRBRC: ""
RUBYOPT: ""
gemset: ""
➜ ~
Thanks for the comments guys, I just fixed it myself.
When i checked the version of gem, it was very old (probably 2.0.4)
trying to do gem update --system was also failed, so i added sudo.
sudo gem update --system did solve the issue.
I did this a few days ago:
$ rvm --default use 2.1.5
but then when I ran ruby -v today I got:
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Is there a better way to permanently set the version of Ruby I use?
==== UPDATE
$ rvm use
Using /Users/snowcrash/.rvm/gems/ruby-2.1.5
$ which rvm
/Users/snowcrash/.rvm/bin/rvm
$ which ruby
/Users/snowcrash/.rvm/rubies/ruby-2.1.5/bin/ruby
and output of rvm info (note that ruby has reverted back to 2.0.0p481):
$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
$ rvm info
ruby-2.1.5:
system:
uname: "Darwin w.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64"
system: "osx/10.10/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.53(1)-release (x86_64-apple-darwin14)"
zsh: "/bin/zsh => zsh 5.0.5 (x86_64-apple-darwin14.0)"
rvm:
version: "rvm 1.26.9 (latest) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "8 days 7 hours 2 minutes 42 seconds ago"
path: "/Users/snowcrash/.rvm"
ruby:
interpreter: "ruby"
version: "2.0.0p481"
date: "2014-05-08"
platform: "universal.x86_64-darwin14"
patchlevel: "2014-05-08 revision 45883"
full_version: "ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]"
homes:
gem: "/Users/snowcrash/.rvm/gems/ruby-2.1.5"
ruby: "/Users/snowcrash/.rvm/rubies/ruby-2.1.5"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/Users/snowcrash/.rvm/gems/ruby-2.1.5/bin/rake"
environment:
PATH: "/Users/snowcrash/.rvm/gems/ruby-2.1.5/bin:/Users/snowcrash/.apportable/SDK/bin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/bin:/Users/snowcrash/Library/ec2-api-tools-1.3-24159/bin:/Users/snowcrash/bin:/Users/snowcrash/Library/android-sdk-mac_86:/Users/snowcrash/Library/android-sdk-mac_86/platform-tools:/Users/snowcrash/Library/bin:/usr/local/mysql/bin:/usr/local/bin:/Library/PostgreSQL/9.1/bin:/usr/local/sbin:/Users/snowcrash/.rvm/gems/ruby-2.1.5/bin:/Users/snowcrash/.rvm/gems/ruby-2.1.5#global/bin:/Users/snowcrash/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/snowcrash/.rvm/bin:/Users/snowcrash/bin/gsutil:/usr/local/graphviz-2.14/bin:/Users/snowcrash/.rvm/bin"
GEM_HOME: "/Users/snowcrash/.rvm/gems/ruby-2.1.5"
GEM_PATH: "/Users/snowcrash/.rvm/gems/ruby-2.1.5:/Users/snowcrash/.rvm/gems/ruby-2.1.5#global"
MY_RUBY_HOME: "/Users/snowcrash/.rvm/rubies/ruby-2.1.5"
IRBRC: "/Users/snowcrash/.rvm/rubies/ruby-2.1.5/.irbrc"
RUBYOPT: ""
gemset: ""
Your PATH contains /usr/bin multiple times, the first of which is before /Users/snowcrash/.rvm/rubies/ruby-2.1.5/bin, so the system provided ruby is added first.
You seem to have a lot of entries in there - review your shells initialisation files (.bashrc, .bash_profile etc) and check anything that manipulates $PATH
What does stuff like rvm use, which rvm or which ruby say? That looks like the system Ruby, which to me means you don't have rvm properly installed and you opened a new terminal session and got the system version.
Or, the command was entered wrong. rvm use --default 2.1.5
After that, rvm list will show it marked as default.
(nick#blerp)-(~)
(507)⚡️ rvm use --default 2.2.0
Using /Users/nick/.rvm/gems/ruby-2.2.0
(nick#blerp)-(~)
(508)⚡️ rvm list
rvm rubies
=* ruby-2.2.0 [ x86_64 ]
# => - current
# =* - current && default
# * - default
You could always reinstall rvm (doesn't hurt to reinstall on top) and make sure the path settings are in your shell dotfiles.
After installing rvm and modifying my .zshrc file when running rvm info i get a different version that when i type ruby -v and when trying to install a gem i get a bunch of errors relating to the system ruby
rvm info output:
$ rvm info
ruby-2.1.1:
system:
uname: "Darwin Joshs-MacBook-Pro.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64"
system: "osx/10.9/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)"
zsh: "/bin/zsh => zsh 5.0.2 (x86_64-apple-darwin13.0)"
rvm:
version: "rvm 1.25.20 (stable) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "3 hours 4 minutes 13 seconds ago"
path: "/Users/joshburns/.rvm"
ruby:
interpreter: "ruby"
version: "2.0.0p247"
date: "2013-06-27"
platform: "universal.x86_64-darwin13"
patchlevel: "2013-06-27 revision 41674"
full_version: "ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]"
homes:
ZSH=$HOME/.oh-my-zsh
gem: "/Users/joshburns/.rvm/gems/ruby-2.1.1"
ruby: "/Users/joshburns/.rvm/rubies/ruby-2.1.1"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/Users/joshburns/.rvm/gems/ruby-2.1.1/bin/rake"
environment:
PATH: "/Users/joshburns/.rvm/gems/ruby-2.1.1/bin:/Users/joshburns/.rvm/gems/ruby-2.1.1#global/bin:/Users/joshburns/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/joshburns/bin:/Users/joshburns/.rvm/bin"
GEM_HOME: "/Users/joshburns/.rvm/gems/ruby-2.1.1"
GEM_PATH: "/Users/joshburns/.rvm/gems/ruby-2.1.1:/Users/joshburns/.rvm/gems/ruby-2.1.1#global"
MY_RUBY_HOME: "/Users/joshburns/.rvm/rubies/ruby-2.1.1"
IRBRC: "/Users/joshburns/.rvm/rubies/ruby-2.1.1/.irbrc"
RUBYOPT: ""
gemset: ""
ruby -v output:
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
I think I have had a similar problem but found the solution here:
http://www.intelligentbee.com/blog/2013/09/17/setup-a-simple-ruby-2-on-rails-4-environment-with-vagrant-and-virtual-box/
Look for the bit:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
rvm use ruby-2.0.0-p247 (replace with your ruby version)
I've set my default ruby version with
rvm use 1.9.3 --default
When opening a new terminal I can see that rvm remembers my default, however the old version of ruby is used:
Last login: Tue Jan 22 17:36:20 on ttys000
➜ ~ rvm list default
Default Ruby (for new shells)
ruby-1.9.3-p374 [ x86_64 ]
➜ ~ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
➜ ~ rvm info
ruby-1.9.3-p374:
system:
uname: "Darwin murzemac.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64"
system: "osx/10.8/x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin12.0)"
rvm:
version: "rvm 1.17.10 () by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "14 hours 46 minutes 38 seconds ago"
ruby:
interpreter: "ruby"
version: "1.8.7"
date: "2012-02-08"
platform: "universal-darwin12.0"
patchlevel: "2012-02-08 patchlevel 358"
full_version: "ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]"
homes:
gem: "/Users/murze/.rvm/gems/ruby-1.9.3-p374"
ruby: "/Users/murze/.rvm/rubies/ruby-1.9.3-p374"
binaries:
ruby: "/usr/bin/ruby"
irb: "/usr/bin/irb"
gem: "/usr/bin/gem"
rake: "/usr/bin/rake"
environment:
PATH: "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/murze/.rvm/bin"
GEM_HOME: "/Users/murze/.rvm/gems/ruby-1.9.3-p374"
GEM_PATH: "/Users/murze/.rvm/gems/ruby-1.9.3-p374:/Users/murze/.rvm/gems/ruby-1.9.3-p374#global"
MY_RUBY_HOME: "/Users/murze/.rvm/rubies/ruby-1.9.3-p374"
IRBRC: "/Users/murze/.rvm/rubies/ruby-1.9.3-p374/.irbrc"
RUBYOPT: ""
gemset: ""
How can 1.9.3 be automatically activated when opening a new terminal window?
My default doesn't always correctly set either, so I've put a .rvmrc in the directory my terminal opens at (or in dirs my terminal is likely to open at) with rvm use default inside.
when I try to use ruby with the terminal, nothing happens.
The last days I've used it and everything worked but it doesn't anymore.
I installed rvm and the 1.9.3 version of ruby.
It works when I launch a script with ruby myscript.rb, and I tried installing rails but when I type gem install rails I get an error:
/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/bin/gem:4: warning: Insecure world writable dir /Users/romainberger/.rvm/gems/ruby-1.9.3-p194 in PATH, mode 040777
As there is no output I don't know where the problem comes from. Does anybody have an idea?
Thanks
EDIT:
rvm info
ruby-1.9.3-p194:
system:
uname: "Darwin romain.home 11.3.0 Darwin Kernel Version 11.3.0: Thu Jan 12 18:47:41 PST 2012; root:xnu-1699.24.23~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin11)"
zsh: "/bin/zsh => zsh 4.3.11 (i386-apple-darwin11.0)"
rvm:
version: "rvm 1.14.1 (master) by Wayne E. Seguin <wayneeseguin#gmail.com>, Michal Papis <mpapis#gmail.com> [https://rvm.io/]"
updated: "1 day 11 hours 59 minutes 3 seconds ago"
ruby:
interpreter: "ruby"
version: "1.9.3p194"
date: "2012-04-20"
platform: "x86_64-darwin11.3.0"
patchlevel: "2012-04-20 revision 35410"
full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.3.0]"
homes:
gem: "/Users/romainberger/.rvm/gems/ruby-1.9.3-p194"
ruby: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194"
binaries:
ruby: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/Users/romainberger/.rvm/gems/ruby-1.9.3-p194#global/bin/rake"
environment:
PATH: "/Users/romainberger/.rvm/gems/ruby-1.9.3-p194/bin:/Users/romainberger/.rvm/gems/ruby-1.9.3-p194#global/bin:/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/romainberger/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin"
GEM_HOME: "/Users/romainberger/.rvm/gems/ruby-1.9.3-p194"
GEM_PATH: "/Users/romainberger/.rvm/gems/ruby-1.9.3-p194:/Users/romainberger/.rvm/gems/ruby-1.9.3-p194#global"
MY_RUBY_HOME: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/Users/romainberger/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: ""
gem info gives me:
ERROR: While executing gem ... (RuntimeError)
Unknown command info
And to launch ruby I just type ruby
To fix the gem warning use:
chmod -R go-w /Users/romainberger/.rvm/
It will recursively remove write right for group and others (keeps write for user).
You can check for RVM related resurces on RVM site: https://rvm.io/