gpt4 book ai didi

ruby - 错误 : "Could not find rake", 尚未安装 Rake

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:11 27 4
gpt4 key购买 nike

为什么我收到这个 Rake 错误:

$ rake --version
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError)
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake:18:in `<main>'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
from /Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

鉴于以下情况:

$ gem list

*** LOCAL GEMS ***

bundler (1.1.3)
rake (0.9.2.2)
rubygems-bundler (1.0.2)
rvm (1.11.3.3)
$ which rake
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake

具体来说:此错误消息是源于错误,还是源于配置问题(如果是后者,那么哪些步骤可能会解决它)?


更新:根据要求增加终端输出:

$ which gem
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/gem
$ whereis rake
/usr/bin/rake
$ echo $PATH # I've edited the output as one item per line for easier reading
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin:
/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194@global/bin:
/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin:
/Volumes/Data/sampablokuper/.rvm/bin:
/opt/local/bin:
/opt/local/sbin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/texbin:
/usr/X11/bin:
/usr/local/git/bin:
/Library/Application Support/VMware Fusion:
/Volumes/Data/sampablokuper/bin:
/Volumes/Data/sampablokuper/.rvm/bin
$ type rvm | head -n1
rvm is a function
$ rvm info

ruby-1.9.3-p194:

system:
uname: "Darwin spksmb.lan 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"

rvm:
version: "rvm 1.14.3 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
updated: "9 hours 36 minutes 53 seconds ago"

ruby:
interpreter: "ruby"
version: "1.9.3p194"
date: "2012-04-20"
platform: "x86_64-darwin10.8.0"
patchlevel: "2012-04-20 revision 35410"
full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]"

homes:
gem: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194"
ruby: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194"

binaries:
ruby: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
irb: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
gem: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
rake: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin/rake"

environment:
PATH: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194/bin:/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194@global/bin:/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/bin:/Volumes/Data/sampablokuper/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin:/usr/local/git/bin:/Library/Application Support/VMware Fusion:/Volumes/Data/sampablokuper/bin"
GEM_HOME: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194"
GEM_PATH: "/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194:/Volumes/Data/sampablokuper/.rvm/gems/ruby-1.9.3-p194@global"
MY_RUBY_HOME: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194"
IRBRC: "/Volumes/Data/sampablokuper/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
RUBYOPT: ""
gemset: ""

最佳答案

“whereis”二进制文件检查由 user.cs_path 变量设置的一组系统默认路径(参见 sysctl -a | grep user.cs_path),而不是实际的 $PATH 变量。因此报告的“rake”位置总是是那组路径中的任何位置,不是实际使用的位置,除非它确实恰好是 < em>仅 rake 安装在系统上,因此不会出现在 $PATH 中。

请运行

which rake

查看实际使用的是哪个 rake 。如果它报告/usr/bin/rake 而不是某些路径,例如/Users/me/.rvm/gems/ruby-1.9.3-p194@global/bin/rake 那么肯定有问题。

请包括

rvm info

输出并确保

type rvm | head -n1

报告“rvm 是一个函数”。如果它报告除此之外的任何内容,则表明您的安装一团糟,在这种情况下,您应该使用 rvm implode 删除您的 rvm 安装,完全注销,然后完全重新安装 RVM。是的,注销步骤很重要。

关于ruby - 错误 : "Could not find rake", 尚未安装 Rake,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11151416/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com