我刚刚在虚拟机中运行的虚拟ubuntu 12.04 32bit上安装了RVM,Ruby,Rails等 . 现在我遇到的问题是,我的第一个rails项目 bundle install
或 bundle update
需要很长时间 . 即使我使用rails创建一个新项目(包括 bundle install
) .
我只使用标准宝石:
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
group :development do
gem 'sqlite3', '1.3.5'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.2'
我尝试了没有任何宝石的捆绑安装,但是 gem 'rails', '3.2.12'
. 之后我再次输入 bundle install
与我的gemfile中的所有宝石 . 我花了10分钟来检查依赖项 . --verbose的输出是 HTTP success
和 HTTP redirection
的混合 .
Rails版本:Rails 3.2.12
Ruby版本:ruby 1.9.3p392(2013-02-22修订版39386)
Rvm:rvm 1.18.18
捆绑版本:Bundler版本1.3.2
我已经搜索了一个解决方案,但没有任何帮助 .
7 回答
在我的 Gemfile 中将
https
更改为http
实现了魔力 . 在我必须使用rails new APP --skip-bundle
创建项目之前I want to warn here, that there is a security purpose for using https over http. Try at first the other answers mentioned in this thread.
Bundler只是got an update并行处理宝石 .
现在将以最好的方式解决问题 .
Source
Bundler v1.12.x于2016年发布,导致一些用户体验slow bundle install issues .
值得前往Rubygems.org尝试不同版本的bundler gem .
检查现有的Bundler版本,卸载现有版本,安装1.11.2版本示例:
您也可以使用多个作业,它可能会有所改善
关于它,这是tutorial
开发人员友好的方法是使用更快的替代方法覆盖gem服务器 .
在我们的示例中,我们可以将
http
配置为镜像以解决慢速https
连接:这允许您保持原始
Gemfile
配置,同时仍然使用更快的http
连接来获取宝石 .如果您想切换回
https
:bundle config
具有默认的--global
选项 . 您可以指定--local
将配置限制为本地应用程序文件夹 .配置保存到全局
~/.bundle/config
和本地.bundle/config
.如果你仍然看到Bundler 1.12.5的这个问题,你可能想要try updating the OpenSSL used by your Ruby .
对我来说,这是这样的:
[...更多
brew
输出......][...很多
rvm
输出...]这应该使
bundle
再次更快,而不要求你从https
到http
.我知道这可能是基本的答案,但尝试从主Ruby站点安装开发人员工具 . 我有一个类似的问题,它确实有效 . 有时简单的解决方案是最好的!
祝好运!