0

在我说:“我已经尝试了一切”之前,我应该在这里发帖。所以,这是我的问题。
我遇到了问题ruby 1.9.3-p194。我的终端卡在每个(!)涉及 ruby​​ 或 rails 的命令上。(例如rails s mongrel,甚至rails -vruby -v

这一切都始于这件奇怪的事情:

$ rvm use 1.9.3-p194
Using /usr/local/rvm/gems/ruby-1.9.3-p194

$ bundle exec rails s mongrel

然后卡住了。所以,我想知道我安装了哪些版本的 ruby​​:

$ rvm list

rvm rubies

ruby-1.8.7-p370 [ i686 ]

# => - current
# =* - current && default
#  * - default

咦?!那么我使用的是未安装的 ruby​​ 版本吗?


经过一些研究,许多建议是重新安装整个软件包。所以,我试过了。

$ rvm uninstall 1.9.3-p194
Removing /usr/local/rvm/src/ruby-1.9.3-p194...
/usr/local/rvm/rubies/ruby-1.9.3-p194 has already been removed.

再次,只是为了确保..

$ rvm uninstall 1.9.3-p194
/usr/local/rvm/src/ruby-1.9.3-p194 has already been removed.
/usr/local/rvm/rubies/ruby-1.9.3-p194 has already been removed.

嗯,看起来不错。(除了在第一次尝试时已经删除了一半...... :| )
然后:

错误 #1

$ rvm reinstall 1.9.3-p194
Removing /usr/local/rvm/src/ruby-1.9.3-p194...
/usr/local/rvm/rubies/ruby-1.9.3-p194 has already been removed.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p194.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
ruby-1.9.3-p194 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p194 (already extracted)
ruby-1.9.3-p194 - #autoreconf
Error running 'autoreconf', please read /usr/local/rvm/log/ruby-1.9.3-p194/autoreconf.log
Skipping configure step, 'configure' does not exist, did autoreconf not run successfully?
ruby-1.9.3-p194 - #compiling

Error running 'make', please read /usr/local/rvm/log/ruby-1.9.3-p194/make.log
There has been an error while running make. Halting the installation.

下一步是:

$ rvm uninstall 1.9.3-p194
Removing /usr/local/rvm/src/ruby-1.9.3-p194...
/usr/local/rvm/rubies/ruby-1.9.3-p194 has already been removed.
Removing default ruby interpreter

$ rvm list

rvm rubies


# No rvm rubies installed yet. Try 'rvm help install'.

所以我检查了help install,但没有发现任何可能有帮助的东西。至少,我还没有看到解决方案..
下一个:

错误 #2

$ rvm install 1.9.3-p194
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p194.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /usr/local/rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #configuring

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/usr/local/rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p194', please read /usr/local/rvm/log/ruby-1.9.3-p194/configure.log
There has been an error while running configure. Halting the installation.

现在,我想卸载 rvm:

$ brew uninstall rvm
Error: No such keg: /usr/local/Cellar/rvm

好的..让我们检查它是否仍然有效..?

$ rvm

<listed standard output, thought that'd be useless here..>

是的,它还在那里。让我们尝试再次安装 1.9.3..

错误 #2(与以前相同..)

$ rvm install 1.9.3
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p327.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracting ruby-1.9.3-p327 to /usr/local/rvm/src/ruby-1.9.3-p327
ruby-1.9.3-p327 - #extracted to /usr/local/rvm/src/ruby-1.9.3-p327
ruby-1.9.3-p327 - #configuring

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include -L/usr/local/rvm/usr/lib ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-1.9.3-p327', please read /usr/local/rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.

然后我找到了一个'解决方案......',#not..

$ umask g+w
$ export -a rvm_configure_env
$ rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')

没有成功。我尝试再次安装 1.9.3,这再次引发错误 #2

我就是这么想的。让我们把所有的东西都内爆..(将其作为可能的解决方案阅读)

$ rvm implode
Are you SURE you wish for rvm to implode?
This will recursively remove /usr/local/rvm and other rvm traces?
(anything other than 'yes' will cancel) > yes
Removing rvm-shipped binaries (rvm-prompt, rvm, rvm-sudo rvm-shell and rvm-auto-ruby)
Removing rvm wrappers in /usr/local/rvm/bin
Hai! Removing /usr/local/rvm
rm: /etc/profile.d/rvm.sh: Permission denied
/usr/local/rvm has been removed.
rvm has been fully removed. Note you may need to manually remove /etc/rvmrc and ~/.rvmrc if they exist still.

哦……Permission denied不错……

$ sudo rvm implode
Password:
sudo: rvm: command not found

万岁!它最终被删除。

让我们重新安装它..

$ gem install rvm
Successfully installed rvm-1.11.3.5
1 gem installed
Installing ri documentation for rvm-1.11.3.5...
Installing RDoc documentation for rvm-1.11.3.5...

什么?!一次尝试后?好的.. :) 但是然后..

错误 #3

$ rvm install 1.9.3-p194
cat: /usr/local/rvm/VERSION: No such file or directory
-bash: /usr/local/rvm/scripts/base: No such file or directory
Unrecognized command line argument: 'impode' ( see: 'rvm usage' )

impode.. ? 什么?!嗯,这可能是来自较早的错字..

然后我尝试了一些其他命令一遍又一遍地返回相同的错误:

ifonteijne:dash Kers$ rvm install 1.9.3-p194
cat: /usr/local/rvm/VERSION: 没有这样的文件或目录
-bash: /usr/local/rvm/scripts/base: 没有这样的文件或目录
无法识别的命令行参数:“imstall”(参见:“rvm usage”)
ifonteijne:dash Kers$ rvm impode
cat: /usr/local/rvm/VERSION: 没有这样的文件或目录
-bash: /usr/local/rvm/scripts/base: 没有这样的文件或目录
无法识别的命令行参数:“impode”(参见:“rvm 用法”)
ifonteijne:dash Kers$ rvm 内爆
cat: /usr/local/rvm/VERSION: 没有这样的文件或目录
-bash: /usr/local/rvm/scripts/base: 没有这样的文件或目录
无法识别的命令行参数:“impode”(参见:“rvm 用法”)
ifonteijne:dash Kers$ rvm install
cat: /usr/local/rvm/VERSION: 没有这样的文件或目录
-bash: /usr/local/rvm/scripts/base: 没有这样的文件或目录
无法识别的命令行参数:“impode”(参见:“rvm 用法”)

现在我被困在......

如果有人可以帮助我,请。

我要安装:Ruby 1.9.3-p194通过RVM

== 编辑 == 试过:

$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )

# Kers,
#
#   Thank you for using RVM!
#   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne

嗯,这行得通。

$ rvm install 1.9.3-p194
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p194.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
You requested building with '/Developer/usr/bin/gcc' but it is not in your path.

$ brew install gcc
==> Installing gcc dependency: gmp
==> Downloading http://ftpmirror.gnu.org/gmp/gmp-5.0.5.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/gmp/5.0.5 --enable-cxx --build=x86_64-apple-darwin
==> make
==> make check
==> make install
                 (...)
Xcode: 4.5.2 => /Volumes/SATA/Applications/Xcode.app/Contents/Developer
CLT: 1.0.0.9000000000.1.1249367152
Error: Homebrew doesn't know what compiler versions ship with your version of
Xcode. Please file an issue with the output of `brew --config`:
  https://github.com/mxcl/homebrew/issues

Error: Failed executing: make (mpfr.rb:31)

如前所述:

$ brew --config
HOMEBREW_VERSION: 0.9.3
HEAD: 360be75b4c4e286365d71664d9a8ab277d7b1fb3
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit arrandale
OS X: 10.8.2-x86_64
Xcode: 4.5.2 => /Volumes/SATA/Applications/Xcode.app/Contents/Developer
CLT: 1.0.0.9000000000.1.1249367152
GCC-4.2: build 5666
LLVM-GCC: build 2335
Clang: 2.1 build 163
X11: 2.7.3 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

希望这可能会有所帮助。

4

1 回答 1

1

感谢rik.vanmechelen的评论,修复了它。

结论:

删除红宝石

$ ruby implode

安装 Ruby

注意:==> Make Bootstrap需要(非常)长时间。

$ curl -L get.rvm.io | bash -s stable --ruby

安装 gcc

注意:这不是它的标准命令,我使用它是因为 Xcode 的“命令行”错误。

$ brew install --use-llvm gcc

安装导轨

$ sudo gem install rails

然后我就可以走了。



rik.vanmechelen,再次感谢。

于 2012-11-21T09:33:55.580 回答