在任何来源中都找不到 rake-0.9.2

发布于 2024-12-07 20:43:47 字数 610 浏览 1 评论 0原文

我不知道为什么我会得到这个?

$ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

ら栖息 2024-12-14 20:43:47

看起来您在某个时候输入了 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 running bundle exec rake instead of just rake.

梅窗月明清似水 2024-12-14 20:43:47

对我来说,添加:

source 'https://rubygems.org'

到我的 Gemfile 解决了问题。由于某种原因,我之前将其删除了。感谢 Andrew 最初提供的有关 .bundle 目录的提示。

For me adding:

source 'https://rubygems.org'

to my Gemfile solved the problem. For some reason I removed it previously. Thanks to Andrew for the tip initially with the .bundle directory.

停顿的约定 2024-12-14 20:43:47

添加 --development 参数一次即可安装 ruby​​gems.org 中的所有开发依赖项。

因此,如果您尝试运行:

bundle exec rake build

而是运行:

bundle --development exec rake build

您将看到正在安装任何缺少的开发依赖项,包括 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:

bundle exec rake build

Instead run:

bundle --development exec rake build

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文