首页 文章

“找不到Rake” - 在OS X 10.8上安装Fresh Ruby on Rails

提问于
浏览
0
Trying to install RoR on OS X 10.8.  New to both Mac and RoR!

Following directions here: 
http://www.justinball.com/2012/10/22/install-rvm-on-mac-osx-mountain-lion/

Installed XCode, Command Line Tools, XQuartz, Homebrew, gcc, latest RVM, executed 
"rvm pkg install openssl", and finally "rvm install 1.9.3"

There were some error messages along the way, which I will provide in a moment. 
However, the install seems successful based on the following:

$ type rvm | head -n1
rvm is a function
$ rails -v
Rails 3.2.8
ruby --version
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12.2.0]

Errors/warnings during install included:
Warning: Could not tap homebrew/dupes/vim over mxcl/master/vim
There has been an error fetching the ruby interpreter. Halting the installation.

Created a new directory named "agile", changed to the directory and executed: 
"rails new demo"
Got "`mkdir': Permission denied" in the first line of the output

Then tried "sudo rails new demo"
Got "Could not find Rake" in the first line of the output

(Full output provided at the end of this post.)

Tried various things to see if there was something wrong with rake, rails, ruby, or rvm, but all seems to come back normal.

Michaels-MacBook-Pro:agile mh$ rake --version
rake, version 0.9.2.2
Michaels-MacBook-Pro:agile mh$ whereis rake
/usr/bin/rake
Michaels-MacBook-Pro:agile mh$ which rake
/Users/mh/.rvm/gems/ruby-1.9.3-p286@global/bin/rake
Michaels-MacBook-Pro:agile mh$ which gem
/Users/mh/.rvm/rubies/ruby-1.9.3-p286/bin/gem
Michaels-MacBook-Pro:agile mh$ rvm info

ruby-1.9.3-p286:

  system:
    uname:       "Darwin Michaels-MacBook-Pro.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64"
    system:      "downloads"
    bash:        "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)"
    zsh:         "/bin/zsh => zsh 4.3.11 (i386-apple-darwin12.0)"

  rvm:
    version:      "rvm 1.16.17 () by Wayne E. Seguin , Michal Papis  [https://rvm.io/]"
    updated:      "7 hours 52 minutes 30 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p286"
    date:         "2012-10-12"
    platform:     "x86_64-darwin12.2.0"
    patchlevel:   "2012-10-12 revision 37165"
    full_version: "ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-darwin12.2.0]"

  homes:
    gem:          "/Users/mh/.rvm/gems/ruby-1.9.3-p286"
    ruby:         "/Users/mh/.rvm/rubies/ruby-1.9.3-p286"

  binaries:
    ruby:         "/Users/mh/.rvm/rubies/ruby-1.9.3-p286/bin/ruby"
    irb:          "/Users/mh/.rvm/rubies/ruby-1.9.3-p286/bin/irb"
    gem:          "/Users/mh/.rvm/rubies/ruby-1.9.3-p286/bin/gem"
    rake:         "/Users/mh/.rvm/gems/ruby-1.9.3-p286@global/bin/rake"

  environment:
    PATH:         "/Users/mh/.rvm/gems/ruby-1.9.3-p286/bin:/Users/mh/.rvm/gems/ruby-1.9.3-p286@global/bin:/Users/mh/.rvm/rubies/ruby-1.9.3-p286/bin:/Users/mh/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin"
    GEM_HOME:     "/Users/mh/.rvm/gems/ruby-1.9.3-p286"
    GEM_PATH:     "/Users/mh/.rvm/gems/ruby-1.9.3-p286:/Users/mh/.rvm/gems/ruby-1.9.3-p286@global"
    MY_RUBY_HOME: "/Users/mh/.rvm/rubies/ruby-1.9.3-p286"
    IRBRC:        "/Users/mh/.rvm/rubies/ruby-1.9.3-p286/.irbrc"
    RUBYOPT:      ""
    gemset:       ""


Michaels-MacBook-Pro:agile mh$ type rvm | head -n1
rvm is a function




===================================================================
Michaels-MacBook-Pro:agile mh$ rails new demo
      create  
/Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': Permission denied - /Users/mh/agile/demo (Errno::EACCES)
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:205:in `each'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:51:in `block in invoke!'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `call'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:133:in `invoke_with_conflict_check'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:50:in `invoke!'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions.rb:95:in `action'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/actions/empty_directory.rb:15:in `empty_directory'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/generators/app_base.rb:103:in `create_root'
    from (eval):1:in `create_root'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/application.rb:38:in `'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/cli.rb:15:in `'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/bin/rails:7:in `'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/rails:19:in `load'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/rails:19:in `'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `'
Michaels-MacBook-Pro:agile mh$ sudo rails new demo
/Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0.8.7) amongst [actionmailer-3.2.8, actionpack-3.2.8, activemodel-3.2.8, activerecord-3.2.8, activeresource-3.2.8, activesupport-3.2.8, arel-3.0.2, builder-3.0.4, erubis-2.7.0, hike-1.2.1, i18n-0.6.1, journey-1.0.4, json-1.7.5, mail-2.4.4, mime-types-1.19, multi_json-1.3.6, polyglot-0.3.3, rack-1.4.1, rack-cache-1.2, rack-ssl-1.3.2, rack-test-0.6.2, rails-3.2.8, railties-3.2.8, rdoc-3.12, sprockets-2.1.3, thor-0.16.0, tilt-1.3.3, treetop-1.4.12, tzinfo-0.3.34] (Gem::LoadError)
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `each'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:750:in `activate'
    from /Users/mh/.rvm/rubies/ruby-1.9.3-p286/lib/ruby/site_ruby/1.9.1/rubygems.rb:1232:in `gem'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/rails:18:in `'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/mh/.rvm/gems/ruby-1.9.3-p286/bin/ruby_noexec_wrapper:14:in `'

1 回答

  • 1

    使用此资源,它会为您安装所有内容:Rails Installer

相关问题