今天我在Mac OSx 10.9.5上从2.0.0升级到Ruby 2.1.3.结果证明比最初的预期更难.而且由于我浪费了很多时间,我认为我分享我的经验和解决方案,以防其他人也遇到问题.
我安装了xcode +开发人员工具.我本周也更新了xcode - 不确定这是否是事情突然无效的原因.但是,这是事实:
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
$ rvm -v
rvm 1.25.32 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
$ brew -v
Homebrew 0.9.5
$ git version
git version 1.9.3 (Apple Git-50)
Run Code Online (Sandbox Code Playgroud)
获取最新版本的Ruby并将其用作默认值:
$ rvm install ruby
$ rvm --default use ruby-2.1.3
Run Code Online (Sandbox Code Playgroud)
现在的问题是,如果我试图检查ruby版本,我得到以下内容:
$ rvm --default use ruby-2.1.3
Using /Users/georg/.rvm/gems/ruby-2.1.3
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib …Run Code Online (Sandbox Code Playgroud) 我正在尝试在ruby rails上创建我的第一个应用程序.
创建我自己的项目所需的所有步骤---- 请参阅此处
在ruby控制台中我键入:
sudo rails new helloworld
Run Code Online (Sandbox Code Playgroud)
..然后它会做一些创造性的东西,直到它击中以下几行:
run bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.1)
Using i18n (0.6.9)
Using minitest (4.7.5)
Using multi_json (1.8.4)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.2)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.2)
Using mime-types (1.25.1) …Run Code Online (Sandbox Code Playgroud)