运行“捆绑安装”失败并要求我运行“捆绑安装”
事实上,当从我从git repo克隆的现有rails应用程序内部运行时,所有与gem相关的命令都会产生相同的错误消息。
$ bundle install Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems. $ gem list Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems. $ bundle update Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems. $ rails -v Could not find tzinfo-0.3.27 in any of the sources Run `bundle install` to install missing gems.
我以为我已经安装了rails …(以下命令是从app目录外部运行的):
$ rails -v Rails 3.0.3 $ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
知道怎么了“捆绑安装”告诉我运行“捆绑安装”?
我退出了我的app目录并手动完成了
sudo gem install tzinfo -v 0.3.27
但是再次进入我的app目录并尝试“捆绑安装”…
$ bundle install Could not find polyglot-0.3.1 in any of the sources Run `bundle install` to install missing gems.
所以我回到了app目录,做了
sudo gem install polyglot -v 0.3.1
“捆绑安装”现在已经产生了
$ bundle install Could not find treetop-1.4.9 in any of the sources Run `bundle install` to install missing gems.
为什么我不得不手动安装我过去没有的所有这些随机gem? (新的开发环境)。 任何人都知道我的环境中可能存在错误吗?
好吧我猜我修好了..
对于运行bundle install
的gem抱怨从app目录内部运行时,我通过访问app目录并逐个执行sudo gem install [gem]
来安装它们。 做bundle install --gemfile=myApp/Gemfile
也安装了几个缺少的gem。
我不知道为什么我无法从app目录中运行bundle install
… lame。
我有这个问题。 有一次我做了:
[root@smaug ~]# PATH=$PATH:~/.gem/ruby/2.0.0/bin
[root@smaug ~]# export PATH
然后它被修复了,我可以
[root@smaug msf3]# bundle install
成功。
问题是你的所有命令实际上都是前缀bundle exec
。 如果您看一下输出,那么捆绑器会告诉您未安装gem。 如果您在rbenv中安装了一些插件,例如rbenv-bundle-exec,rbenv-bundler或rbenv-binstubs,就会发生这种情况。 至少对我来说,这是第一次尝试在项目中bundle install
时发生的,因为它实际上检测到当前文件夹中有一个Gemfile
并尝试执行bundle exec bundle install
,这显然不起作用。
您可以使用Tim的解决方案,并从项目文件夹外部运行bundle install。
您可以暂时禁用或卸载将bundle exec
添加到ruby命令的扩展。
或者如果因为你使用rbenv-bundle-exec而发生问题,那么就这样做:
NO_BUNDLE_EXEC=1 bundle install
从rubyinstaller安装ruby
然后gem install bundle
在win 10 PC上为我解决了这个问题。
我有一个非常相似的问题,在尝试了很多不同的东西之后我终于找到了一个简单的解决方案,但是我重新启动了我的计算机(mac os 10.9x)。 可不是闹着玩的。