2010-08-11 118 views
9

这是一种奇怪的。无论何时我进行捆绑安装,Bundler都会将所有宝石安装到路径#{RAILS_ROOT} /json_pure/ruby/1.8/gems。我直接从另一个完美工作的应用程序复制Gemfile,并且我认为我没有修改任何其他配置。任何想法可能会发生在这里?Bundler在错误位置安装宝石

不知道是否有帮助,但我的Gemfile.lock的低于:

GEM 
    remote: http://rubygems.org/ 
    specs: 
    GData (0.0.4) 
     builder (>= 2.1.2) 
     hoe (>= 1.2.1) 
    abstract (1.0.0) 
    actionmailer (3.0.0.rc) 
     actionpack (= 3.0.0.rc) 
     mail (~> 2.2.5) 
    actionpack (3.0.0.rc) 
     activemodel (= 3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
     builder (~> 2.1.2) 
     erubis (~> 2.6.6) 
     i18n (~> 0.4.1) 
     rack (~> 1.2.1) 
     rack-mount (~> 0.6.9) 
     rack-test (~> 0.5.4) 
     tzinfo (~> 0.3.22) 
    activemodel (3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
     builder (~> 2.1.2) 
     i18n (~> 0.4.1) 
    activerecord (3.0.0.rc) 
     activemodel (= 3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
     arel (~> 0.4.0) 
     tzinfo (~> 0.3.22) 
    activeresource (3.0.0.rc) 
     activemodel (= 3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
    activesupport (3.0.0.rc) 
    arel (0.4.0) 
     activesupport (>= 3.0.0.beta) 
    bcrypt-ruby (2.1.2) 
    builder (2.1.2) 
    capybara (0.3.9) 
     culerity (>= 0.2.4) 
     mime-types (>= 1.16) 
     nokogiri (>= 1.3.3) 
     rack (>= 1.0.0) 
     rack-test (>= 0.5.4) 
     selenium-webdriver (>= 0.0.3) 
    chronic (0.2.3) 
     hoe (>= 1.2.1) 
    columnize (0.3.1) 
    configuration (1.1.0) 
    crummy (0.1.0) 
    culerity (0.2.10) 
    database_cleaner (0.5.2) 
    devise (1.1.rc2) 
     bcrypt-ruby (~> 2.1.2) 
     warden (~> 0.10.7) 
    erubis (2.6.6) 
     abstract (>= 1.0.0) 
    factory_girl (1.3.2) 
    factory_girl_rails (1.0) 
     factory_girl (~> 1.3) 
     rails (>= 3.0.0.beta4) 
    faker (0.3.1) 
    ffi (0.6.3) 
     rake (>= 0.8.7) 
    geokit (1.5.0) 
    haml (3.0.16) 
    hirb (0.3.2) 
    hoe (2.6.1) 
     rake (>= 0.8.7) 
     rubyforge (>= 2.0.4) 
    hpricot (0.8.2) 
    i18n (0.4.1) 
    json (1.4.6) 
json_pure (1.4.6) 
    launchy (0.3.7) 
     configuration (>= 0.0.5) 
     rake (>= 0.8.1) 
    libxml-ruby (1.1.4) 
    linecache (0.43) 
    mail (2.2.5) 
     activesupport (>= 2.3.6) 
     mime-types 
     treetop (>= 1.4.5) 
    mime-types (1.16) 
    nokogiri (1.4.3.1) 
    paperclip (2.3.3) 
     activerecord 
     activesupport 
    polyglot (0.3.1) 
    populator (0.2.5) 
    rack (1.2.1) 
    rack-mount (0.6.9) 
     rack (>= 1.0.0) 
    rack-test (0.5.4) 
     rack (>= 1.0) 
    rails (3.0.0.rc) 
     actionmailer (= 3.0.0.rc) 
     actionpack (= 3.0.0.rc) 
     activerecord (= 3.0.0.rc) 
     activeresource (= 3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
     bundler (>= 1.0.0.rc.1) 
     railties (= 3.0.0.rc) 
    railties (3.0.0.rc) 
     actionpack (= 3.0.0.rc) 
     activesupport (= 3.0.0.rc) 
     rake (>= 0.8.3) 
     thor (~> 0.14.0) 
rake (0.8.7) 
    roo (1.3.11) 
     GData (>= 0.0.4) 
     hpricot (>= 0.6) 
     libxml-ruby (>= 1.1.3) 
     rubyzip (>= 0.9.1) 
     spreadsheet (>= 0.6.4) 
    ruby-debug (0.10.3) 
     columnize (>= 0.1) 
     ruby-debug-base (~> 0.10.3.0) 
    ruby-debug-base (0.10.3) 
     linecache (>= 0.3) 
    ruby-ole (1.2.10.1) 
    rubyforge (2.0.4) 
     json_pure (>= 1.1.7) 
    rubyzip (0.9.4) 
    selenium-webdriver (0.0.27) 
     ffi (>= 0.6.1) 
     json_pure 
     rubyzip 
    shoulda (2.11.0) 
    spork (0.8.4) 
    spreadsheet (0.6.4.1) 
     ruby-ole 
    sqlite3-ruby (1.3.1) 
    thor (0.14.0) 
    treetop (1.4.8) 
     polyglot (>= 0.3.1) 
    tzinfo (0.3.22) 
    warden (0.10.7) 
     rack (>= 1.0.0) 
    will_paginate (3.0.pre) 
    wirble (0.1.3) 
PLATFORMS 
    ruby 

DEPENDENCIES 
    capybara 
    chronic 
    crummy 
    database_cleaner 
    devise (= 1.1.rc2) 
    factory_girl_rails 
    faker 
    geokit 
    haml 
    hirb 
    hpricot 
    json 
    launchy 
    paperclip 
    populator 
    rails (= 3.0.0.rc) 
    roo (= 1.3.11) 
    ruby-debug 
    shoulda (= 2.11) 
    spork 
    sqlite3-ruby 
    will_paginate (= 3.0.pre) 
    wirble 

回答

10

嗯..只是猜测,不知怎的,当你最初安装捆绑到。尝试用此重新安装:

您可以在通过bundle install /path/to/bundle进行安装时指定此设置。捆绑会记得您安装的依赖于特定的计算机上为未来的安装,加载,设置等

而且这是卡尔·胡达的建议进行故障排除:

rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock 
bundle install 
+0

这对我有效。如果它可以帮助任何人,我想我在某个时候通过睡觉地输入'bundle install coffee-script'来触发这一点。 – TLK 2011-12-23 22:18:43

+0

只要删除.bundle为我工作。我不认为你需要删除Gemfile.lock – asgeo1 2012-01-16 08:55:57

24

如果你不小心输入bundle install SOME_GEM它似乎永久性地将您的gem目录设置为SOME_GEM。

貌似可以恢复正常使用bundle install --system

命令行界面失效

从想通了:http://www.theirishpenguin.com/2011/03/05/bundler-installing-gems-into-the-wrong-directory-mea-culpa/

+0

我不明白为什么bundler不会只使用您当前的rvm目录?为什么它不够聪明知道你正在使用这个rvm gemset,它应该安装在那里? – wallerjake 2014-02-06 21:39:03

3

你可能已经得到BUNDLE_PATH:在设置。 bundle/config。更改或删除该行。

+0

+1如果您按照@Brian的建议执行'bundle install --system',会发生什么情况。 – 2013-05-03 11:43:03

0

有同样的问题后,我升级的Xcode

我不得不跑: 须藤的Xcode选 - 水阀/库/开发商/ CommandLineTools/
则: sudo的包安装--system

之后,一切都很好。