Bundler 将我的 gems 放在我的项目目录中 [英] Bundler puts my gems in my project directory

查看:15
本文介绍了Bundler 将我的 gems 放在我的项目目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Ruby 1.9.2 上有一个运行良好的 Rails 3rc 应用程序,但 Bundler 一直在我的项目目录中创建一个名为bandsintown"的文件夹(bandsintown 是我使用的 gem).据我所知,该文件夹中包含我所有的宝石.我很确定这从未发生过.这是正常行为吗?

I have a Rails 3rc app on Ruby 1.9.2 that works fine, but Bundler keeps making a folder named "bandsintown" (bandsintown is a gem I use) in my project directory. From what I can tell, the folder has all my gems in it. I'm pretty sure that this never happened before. Is it normal behavior?

我认为这可能会干扰运行测试.我收到命令失败,状态 (1)"错误,然后它多次提到bandsintown"文件夹.

I think this might be interfering with running tests. I get a "Command failed with status (1)" error and then it mentions the "bandsintown" folder a few times.

我觉得 Bundler 将文件夹命名为bandsintown"很奇怪,即使我在 gemfile 中注释掉了那个 gem.该文件夹中有一个ruby"文件夹,ruby"文件夹中有一个1.9.1"文件夹.我不明白为什么当我使用 1.9.2 时它说 1.9.1.1.9.1 文件夹内有 bin、bundler、cache、doc、gems 和 specification 文件夹.

I find it odd that Bundler names the folder "bandsintown" even when I comment out that gem in the gemfile. There's a "ruby" folder in that one, and a "1.9.1" folder inside the "ruby" folder. I don't understand why it says 1.9.1 when I'm using 1.9.2. The 1.9.1 folder has a bin, bundler, cache, doc, gems and specification folder inside of it.

我用所有相同的 gem 制作了一个 testapp 并进行了捆绑安装.它不会创建一个包含我所有宝石的新文件夹.

I made a testapp with all the same gems and did a bundle install. It doesn't make a new folder with all my gems in it.

无论如何,我的应用程序运行良好,但如果有人可以在这里帮助我,我将不胜感激.如果我遗漏了任何需要知道的信息,请告诉我.谢谢.

Anyway, my app works fine, but I'd appreciate it if anyone could help me out here. If I left out any need-to-know information, let me know. Thanks.

推荐答案

您可能正在运行以下命令:bundle install bandintown.该命令告诉 bundler 将 gem 安装到应用程序的 bandsintown 子目录中.为了安装 gems,你需要做的就是修改你的 Gemfile 并运行 bundle install.

You are probably running the following command: bundle install bandsintown. That command tells bundler to install gems into the bandsintown subdirectory of your application. In order to install gems, all you need to do is modify your Gemfile and run bundle install.

Bundler 会记住您上次在 .bundle/config 文件中指定的位置.所以,为了重置"捆绑器的内存.在您的应用程序目录中,运行 rm -r .bundle/config.

Bundler will remember the location that you last specified in the .bundle/config file. So, in order to "reset" bundler's memory. In your application's directory, run rm -r .bundle/config.

然后,在更新您的 Gemfile 之后,只需运行 bundle install

Then, after updating your Gemfile, simply run bundle install

这篇关于Bundler 将我的 gems 放在我的项目目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆