Ruby on rails “运行”;“捆绑安装”;失败并要求我运行“;“捆绑安装”;

Ruby on rails “运行”;“捆绑安装”;失败并要求我运行“;“捆绑安装”;,ruby-on-rails,ruby,installation,rvm,bundle,Ruby On Rails,Ruby,Installation,Rvm,Bundle,事实上,当从我从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 in

事实上,当从我从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。。。(以下命令是从应用程序目录外运行的):

知道“bundle安装”告诉我运行“bundle安装”是怎么回事吗


我退出了我的应用程序目录,并手动退出

sudo gem install tzinfo -v 0.3.27
但当再次进入我的应用程序目录并尝试“捆绑安装”时

所以我又回到了应用程序目录,是吗

sudo gem install polyglot -v 0.3.1
“bundle安装”现在已经完成

$ 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]
来安装它们。正在进行捆绑安装--gemfile=myApp/gemfile还安装了一些缺失的gem


我不知道为什么我不能从应用程序目录中运行
捆绑安装
。我遇到了这个问题。我曾经:

[root@smaug~]#PATH=$PATH:~/.gem/ruby/2.0.0/bin

[root@smaug~]#导出路径

然后就修好了,我就可以

[root@smaugmsf3]#捆绑安装


成功。

我遇到了一个非常类似的问题,在尝试了许多不同的方法之后,我终于找到了一个简单的解决方案……我重新启动了我的计算机(mac os 10.9x)。别开玩笑了

问题是,您的所有命令实际上都在
bundle exec
前面加了前缀。如果您查看输出,bundler会告诉您您的gems没有安装。如果您在rbenv中安装了一些插件,如rbenv bundle exec、rbenv bundler或rbenv binstubs,则可能会发生这种情况。 至少对我来说,这是您第一次尝试在项目中安装
bundle
时发生的,因为它实际上检测到当前文件夹中存在
Gemfile
,并尝试执行
bundle exec bundle install
,这显然不起作用

您可以使用Tim的解决方案,并从项目文件夹外部运行bundle安装

您可以暂时禁用或卸载将
bundle exec
前置到ruby命令的扩展

或者,如果由于使用rbenv bundle exec而出现问题,只需执行以下操作:

NO\u BUNDLE\u EXEC=1 BUNDLE安装

从安装ruby


然后
gem安装bundle
为我在win 10 PC上解决了这个问题。

bundle exec bash
也会有同样的效果

确保未设置环境变量


如果是,则表示您处于
bundle exec
子进程中。

您的GEM文件中包含什么,它是否包含
源代码http://rubygems.org“
?它包含源代码:rubygems,添加源代码”没有帮助,同样的错误。另外。。。事实证明,我可以运行bundle安装--gemfile=myApp/gemfile,但由于另一个错误(我认为是无关的)它失败了。为什么我不能从应用程序目录中运行bundle安装?当您执行“gem安装”时,它会将其全局安装到您的ruby版本(假设您使用的是Rbenv),因此“gem list”将显示这些。当您进行捆绑安装时,它会为特定项目安装gems,在您的项目文件夹中,“bundle show”将显示该项目的gems。当您有很多项目时,您不想污染您的全球gems-它们应该(意见、最佳实践)按项目安装。请尝试
捆绑更新
,而不是
捆绑安装
。用@ConnorLeech为meAgree解决了这个问题
bundle update
是一个简单的解决方案,对我来说也很有效。我通过运行
$gem install bundler
解决了这个问题。这将更新(或安装)您可能已过时的捆绑程序。要查看更详细的解释,问题是配置了
~/.gemrc
文件。这是个好地方。
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.