Ruby无法在Mac OS X上启动 [英] Ruby not starting on mac os x
问题描述
当我尝试在终端上使用ruby时,什么也没发生.
最近几天我一直在使用它,并且一切正常,但现在不再使用了.
我安装了rvm和1.9.3版本的ruby.
当我使用ruby myscript.rb
启动脚本并尝试安装rails时,它可以工作,但是当我键入gem install rails
时出现错误:
/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
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?
谢谢
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
给我:
ERROR: While executing gem ... (RuntimeError)
Unknown command info
要启动红宝石,我只需输入ruby
And to launch ruby I just type ruby
推荐答案
要修复gem警告,请使用:
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).
您可以在RVM网站上检查与RVM相关的资源: https://rvm.io/
You can check for RVM related resurces on RVM site: https://rvm.io/
这篇关于Ruby无法在Mac OS X上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!