在任何来源中都找不到 rake-0.9.2
我不知道为什么我会得到这个?
$ which rake
/Users/kamilski81/.rvm/gems/ruby-1.9.2-p290@depot/bin/rake
[~/Sites/work/depot, kamilski81@mac]
$ /Users/kamilski81/.rvm/gems/ruby-1.9.2-p290\@depot/bin/rake test
Could not find rake-0.9.2 in any of the sources
Run `bundle install` to install missing gems.
在我执行“捆绑安装”后,我得到:
Installing sqlite3 (1.3.4) with native extensions
Installing turn (0.8.2)
Installing uglifier (1.0.3)
Updating .gem files in vendor/cache
Your bundle is complete! It was installed into ./rake
并且我的所有宝石都安装到我的根目录的 ./rake 中......非常烦人。
I have no idea why I am getting this?
$ which rake
/Users/kamilski81/.rvm/gems/ruby-1.9.2-p290@depot/bin/rake
[~/Sites/work/depot, kamilski81@mac]
$ /Users/kamilski81/.rvm/gems/ruby-1.9.2-p290\@depot/bin/rake test
Could not find rake-0.9.2 in any of the sources
Run `bundle install` to install missing gems.
After I do a "bundle install" I get :
Installing sqlite3 (1.3.4) with native extensions
Installing turn (0.8.2)
Installing uglifier (1.0.3)
Updating .gem files in vendor/cache
Your bundle is complete! It was installed into ./rake
and all my gems are installed into ./rake of my root dir...pretty annoying.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看起来您在某个时候输入了
bundle install rake
。bundle
命令不使用 gem 的名称来安装。相反,参数“rake”是您安装捆绑的 gem 的文件夹的名称。如果您查看当前的项目文件夹,您将看到一个隐藏的 .bundle 目录。其中的配置文件会跟踪您如何设置捆绑安装选项,并且它会记住您下次运行捆绑安装时设置的目录。最简单的方法是从该配置文件中删除该选项,然后重新运行不带第三个参数的
bundle install
。这个问题的第二部分是不同的包将安装自己版本的命令,例如 rake。为了运行正确的版本,请让捆绑程序通过运行
bundle exec rake
而不仅仅是rake
来为您运行它。It looks like you typed
bundle install rake
at some point.The
bundle
command doesn't take the name of a gem to install. Instead, the parameter "rake" is the name of the folder that you install your bundled gems into.If you look in your current project folder, you will see a hidden .bundle directory. The config file in there keeps track of how you set up your bundle install options, and it remembers the directory you set for the next time you run bundle install. The easiest thing to do is to remove the option from that config file, and re-run
bundle install
without a third parameter.The second part of this issue is that different bundles will install their own version of the commands such as
rake
. In order to run the correct version, have bundler run it for you by runningbundle exec rake
instead of justrake
.对我来说,添加:
到我的 Gemfile 解决了问题。由于某种原因,我之前将其删除了。感谢 Andrew 最初提供的有关 .bundle 目录的提示。
For me adding:
to my Gemfile solved the problem. For some reason I removed it previously. Thanks to Andrew for the tip initially with the .bundle directory.
添加
--development
参数一次即可安装 rubygems.org 中的所有开发依赖项。因此,如果您尝试运行:
而是运行:
您将看到正在安装任何缺少的开发依赖项,包括
rake 0.9.2
。此后,在重建时可以删除
--development
参数。请注意,此方法还意味着您不需要需要将
源http://rubygems.org
添加到您编写的每个gem中。Add the
--development
parameter once to install all development dependencies from rubygems.org .So if you're trying to run:
Instead run:
You'll see any missing development dependencies being installed, including
rake 0.9.2
.Thereafter the
--development
parameter can be removed when you rebuild.Note that this method also means you don't need to add
source http://rubygems.org
to every gem you write.