1

I'm so frustrated. I just wiped my computer clean for a new start, after trying for several days to get rails installed. I followed this tutorial http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-4

It actually worked too, but when I woke up the next morning, I got this new "error"

Everything seemed to be working. I installed xcode, homebrew first, and then installed RVM. and it all seems to be working. I have ruby 2.0.0, but when I type "rails -v" after installing I get the following:

$ rails -v
/Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/dependency.rb:247:in `to_specs': Could not find minitest (~> 4.2) amongst [actionmailer-4.0.0, actionmailer-3.2.13, actionpack-4.0.0, actionpack-3.2.13, activemodel-4.0.0, activemodel-3.2.13, activerecord-4.0.0, activerecord-3.2.13, activerecord-deprecated_finders-1.0.3, activeresource-3.2.13, activesupport-4.0.0, activesupport-3.2.13, arel-4.0.0, arel-3.0.2, atomic-1.1.10, builder-3.1.4, builder-3.0.4, bundler-1.3.5, bundler-unload-1.0.1, erubis-2.7.0, hike-1.2.3, i18n-0.6.4, i18n-0.6.1, journey-1.0.4, json-1.8.0, mail-2.5.4, mime-types-1.23, multi_json-1.7.7, polyglot-0.3.3, rack-1.5.2, rack-1.4.5, rack-cache-1.2, rack-ssl-1.3.3, rack-test-0.6.2, rails-4.0.0, rails-3.2.13, railties-4.0.0, railties-3.2.13, rake-10.1.0, rdoc-3.12.2, rubygems-bundler-1.2.0, rubygems-update-1.8.24, rvm-1.11.3.8, sprockets-2.10.0, sprockets-2.2.2, sprockets-rails-2.0.0, thor-0.18.1, thread_safe-0.1.0, tilt-1.4.1, treetop-1.4.14, tzinfo-0.3.37] (Gem::LoadError)
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:777:in `block in activate_dependencies'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:766:in `each'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:766:in `activate_dependencies'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:750:in `activate'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:780:in `block in activate_dependencies'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:766:in `each'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:766:in `activate_dependencies'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/specification.rb:750:in `activate'
    from /Users/johncurry/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems.rb:1232:in `gem'
    from /Users/johncurry/.rvm/gems/ruby-2.0.0-p247/bin/rails:18:in `<main>'
    from /Users/johncurry/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/johncurry/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>'

Please help. I've been trying for three days and even completely reset my computer. and I am so close. What do I need to do?

4

1 回答 1

2

好的,退后一步,深呼吸。该教程有点有害,因为它没有向您展示 RVM rubies、gems 和 gemsets 的各个步骤,而是在一个命令中完成。

首先,使用此命令检查您安装了哪些 ruby

rvm list

这将打印出您已安装的内容,如下所示

   ruby-1.9.3-p385 [ x86_64 ]
   ruby-1.9.3-p392 [ x86_64 ]
=* ruby-2.0.0-p0 [ x86_64 ]

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

现在看起来你有 2.0.0,让它成为默认的 ruby

rvm use 2.0.0 --default

现在让我们创建一个名为 的 gemset rails-3.2.13,这是我们将安装 rails gem 的地方

rvm gemset create rails-3.2.13

让这个 gemset 成为当前使用的默认 gemset

rvm gemset use rails-3.2.13 --default

安装导轨的时间

gem install rails -v 3.2.13

现在,当您键入时,rails -v它应该会显示此版本的 rails。另外,因为我们将默认设置为ruby 2.0.0,而 gemset 设置为rails-3.2.13,所以每次打开一个新终端时,它都是相同的 ruby​​ 和 rails 版本。

查看RVM 网站和文档,了解 rvm 可以做的其他一千件事。祝你好运

于 2013-07-03T22:27:09.560 回答