繁体   English   中英

我删除了ruby 2.1.1无法再次安装Mac OS 10.7.5

[英]I deleted ruby 2.1.1 cannot install it again mac os 10.7.5

我是终端机的初学者,我想学习Rails。 我的Mac上装有Lion 10.7.5。 我想安装Rails,并且似乎已安装,然后当我键入rails -vi时收到以下消息:

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

所以我去了堆栈溢出,看到很多人有同样的问题。 所以我尝试了人们推荐的方法,但没有一个起作用。 然后我做出了一个不明智的决定,删除ruby2.1.1以便使用以下命令重新安装它:

 brew install ruby

然后开始混乱:

Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please install the CLT or Xcode 4.6.3.

我已经有Xcode 4.6.3

Warning: It appears you have MacPorts or Fink installed.

不知道该怎么办

Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

Warning: ruby-2.1.1 already installed

所以我输入:rvm use ruby​​ 2.1.1

我得到了:

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is   not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.
ruby-2.1.1 is not installed.

To install do: 'rvm install ruby-2.1.1'

所以我做到了,我得到了:

Downloaded archive checksum did not match, archive was removed!
If you wish to continue with not matching download add '--verify-downloads 2' after the command.
Downloading https://rvm.io/binaries/osx/10.7/x86_64/ruby-2.1.1.tar.bz2 failed.

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-O3 - 
I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure -- 
prefix=/Users/me/.rvm/rubies/ruby-2.1.1 --disable-install-doc --enable-shared',
showing last 15 lines of /Users/me/.rvm/log/1397387601_ruby-2.1.1/configure.log

谢谢您的帮助,我不知道该怎么办

附:其他测试:红宝石-v我有

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

rvm列表

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is  not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.

rvm使用ruby-2.1.1

 ruby-2.1.1 is not installed.

回声$ PATH

/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Users/me/.rvm/gems/ruby-2.1.1/bin:/Users/me/.rvm/gems/ruby-2.1.1@global/bin:/Users/me/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:/Users/me/.rvm/bin:/Users/me/.rvm/bin:/Users/me/.rvm/bin

哪个红宝石

/usr/bin/ruby

rvm卸载ruby-2.1.1

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.
ruby-2.1.1 - #removing src/ruby-2.1.1..
ruby-2.1.1 - #removing default ruby interpreter............

和我的.bash_profile

 [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 
  [[ -s      "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
# Load RVM into a shell     session *as a function* 
 PATH=$PATH:$HOME/.rvm/bin source "$HOME/.rvm/scripts/rvm"

最后是我的.bashrc

export PATH="/usr/local/heroku/bin:$PATH"

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source "$HOME/.rvm/scripts/rvm

问题出在您的.bash_profile的最后一行,请按如下所示进行更改,然后重试:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

PATH=$PATH:$HOME/.rvm/bin

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM