1

在我的 rails 应用程序目录之外,bundle install _a_gem_当我的意思是gem install _a_gem. 已经好几个小时了。在此之后,我无法让我的环境正常工作。在我的应用程序内部运行gem list只给了我后来安装的_a_gem_。在我的应用程序之外运行gem list会为我提供我想要的 gem 列表以及我最初与该应用程序一起使用的那些。

(o) 应用程序目录外 (i) 应用程序目录内

哪个宝石

/Users/name/.rvm/rubies/ruby-1.9.2-p290/bin/gem   (o)
/Users/name/.rvm/rubies/ruby-1.9.2-p290/bin/gem   (i)

哪个irb

/Users/name/.rvm/rubies/ruby-1.9.2-p290/bin/irb   (o)
/Users/name/.rvm/rubies/ruby-1.9.2-p290/bin/irb   (i)


bundle install (o)
Could not locate Gemfile 

bundle install (i)
/Users/...rubygems/dependency.rb:247:in `to_specs': Could not find bundler (>= 0) amongst [spreadsheet-0.8.2] (Gem::LoadError)

gem list (o) has all gems (i) has just _a_gem_ from my rails app.

gems/bundler 命令在应用程序目录内的任何地方都可以正常工作。我尝试重新安装捆绑器但发生冲突:

(一世)

/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1603:in    `raise_if_conflicts': can't activate bundler-1.3.0, already activated bundler-1.0.21 (Gem::LoadError)

任何帮助是极大的赞赏。谢谢你。

额外:当我gem install bundler尝试使用捆绑器命令时的跟踪,例如bundle install

/Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1603:in `raise_if_conflicts': can't activate bundler-1.3.0, already activated bundler-1.0.21 (Gem::LoadError)
from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:738:in `activate'
from /Users/name/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems.rb:1211:in `gem'
from /Users/name/.rvm/gems/ruby-1.9.2-p290/bin/bundle:18:in `<main>'

更新:gem env目录内外的输出

https://gist.github.com/yuric/5069049

4

1 回答 1

2

我发现这组说明对于解决捆绑程序问题非常有用:

# remove user-specific gems and git repos
rm -rf ~/.bundle/ ~/.gem/

# remove system-wide git repos and git checkouts
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/

# remove project-specific settings and git repos
rm -rf .bundle/

# remove project-specific cached .gem files
rm -rf vendor/cache/

# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock

# try to install one more time
bundle install

这是我在 github 上遇到这些的原始页面的链接。他们通常会为我解决捆绑程序问题。

https://github.com/carlhuda/bundler/blob/1-0-stable/ISSUES.md

于 2013-03-02T01:35:21.667 回答