gpt4 book ai didi

ruby-on-rails - 在 Mac OS X Lion 上安装 Ruby 1.9.3 和 Rails 3.1.3 时出错

转载 作者:数据小太阳 更新时间:2023-10-29 08:28:47 24 4
gpt4 key购买 nike

当我想在 OS X 上安装 Ruby 1.9.3 时出现错误。我发现大部分问题都来自未安装 xCode。所以,我安装了它,但问题仍然存在,所以,这里是:

MacBook-Pro-de-Arnaud:~ Arnaud$ rvm install 1.9.3
Installing Ruby from source to: /Users/Arnaud/.rvm/rubies/ruby-1.9.3-p0, this may take a >while depending on your cpu(s)...

ruby-1.9.3-p0 - #fetching
ruby-1.9.3-p0 - #extracted to /Users/Arnaud/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/Arnaud/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/Arnaud/.rvm/src
Configuring yaml in /Users/Arnaud/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/Arnaud/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/Arnaud/.rvm/usr
ruby-1.9.3-p0 - #configuring
ERROR: Error running ' ./configure --prefix=/Users/Arnaud/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/Arnaud/.rvm/usr ', please read /Users/Arnaud/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.

所以,我决定让 1.8.7 直接转到 Rails,安装似乎进行得很顺利,但没有安装 :/

MacBook-Pro-de-Arnaud:~ Arnaud$ sudo gem install rails
Password:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
MacBook-Pro-de-Arnaud:~ Arnaud$ gem list

*** LOCAL GEMS ***


MacBook-Pro-de-Arnaud:~ Arnaud$ rail
-bash: rail: command not found
MacBook-Pro-de-Arnaud:~ Arnaud$ rails
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/rails:18

谁有解决办法吗?

最佳答案

rvm install 1.9.3 --with-gcc=clang

按照建议here为我工作。

关于ruby-on-rails - 在 Mac OS X Lion 上安装 Ruby 1.9.3 和 Rails 3.1.3 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8324497/

24 4 0
文章推荐: ruby - 在 Ruby 中,如何通过 Sinatra 获取 `li` 标记内的链接?
文章推荐: Ruby:直到一个新对象有一些属性
文章推荐: ruby - 使用 Watir 将整个 html 导出到文本文档