Tag: bundler

CircleCIgem缓存

是否可以缓存gem,以便bundle install不会为每个构建安装一堆gem? 每次构建需要5分钟,这太多了。 我已将此添加到circle.yml配置中: dependencies: cache_directories: – “/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/” 这是bundle show gem_name提供的公共目录,其中放置了所有系统gem。 此添加系统写入此类日志后: restoring cache v4/company/repo_name/dependency/circle-ci/42/mGWhlYQIxyOy0GZtt4QmCw__.tar.gz restoring home/ubuntu/repo_name/vendor/bundle, home/ubuntu/.m2, home/ubuntu/.ivy2, home/ubuntu/.go_workspace, home/ubuntu/.gradle, home/ubuntu/.rvm/gems/ruby-2.1.2/gems 所以,据我所知,它恢复了安装在vendor/bundle系统gem和gem,但是,我仍然看到了这个(这需要花费很多时间): Installing rake 10.4.2 Installing i18n 0.7.0 Installing json 1.8.2 Installing minitest 5.5.1 … 代替 using rake 10.4.2 using i18n 0.7.0 using json 1.8.2 using minitest 5.5.1 … 所以,似乎它应该有效,但事实并非如此。 有什么不对?

〜>符号在捆绑器Gemfile中的含义是什么?

我的问题几乎就在标题中。 例如,在使用Rails 3.1应用程序创建的默认Gemfile中; gem ‘sass-rails’, ‘~> 3.1.5’ 好像我应该知道这一点,但我在Bundler网站上找不到任何引用。

NameError:未初始化的常量Gem :: SourceIndex

在访问主页时(成功运行bundle install ),新的rails应用程序出现此错误,未进行任何修改。 以下是版本号: ruby: 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1] rails: 3.2.12 rvm: 1.18.14 gem: 2.0.0 bundler: 1.3.0.pre.8 调用which ruby返回/Users/J/.rvm/rubies/ruby-1.9.3-p392/bin/ruby ,看起来很腥,对吗?

由于缺少sqlite3 gem,Rails 4.0rc1应用程序未运行

我第一次尝试安装Rails 4.0。 在带有Ruby 2.0 x64的Windows 8上。 冉: gem install rails –version 4.0.0.rc1 –no-ri –no-rdoc 然后我跑: rails new test_app cd test_app rails s 但localhost:3000的网页报告以下错误: 为数据库适配器指定’sqlite3’,但未加载gem。 将gem’sqlite3 gem ‘sqlite3’添加到您的Gemfile中。 它在我的Gemfile中: gem ‘sqlite3’ 我尝试多次运行bundle install ,它甚至没有在所有其他gem中列出它。 更新 :我尝试以两种不同的方式安装sqlite3 gem,两者都使用从DevKit的msys.bat文件打开的终端。 @szines下面提到的方式给了我以下错误: $ gem install sqlite3 –platform=ruby — –with-opt-dir=c:/sqlite-amalgamation-3071602 Temporarily enhancing PATH to include DevKit… Building native extensions with: ‘–with-opt-dir=c:/sqlite-amalgamation-3071602’ […]

供应商/捆绑的目的是什么? Heroku告诉我要删除它

在向Heroku推送一些更改后,我注意到有关vendor/bundle 警告 (请参阅下面的警告 )。 如果根据警告它应该从Git跟踪中“删除”,这个目录的目的是什么? 为什么vendor/bundle没有自动.gitignore默认为Rails? 我应该运行bundle pack吗? (它实际上是bundle package ??) bundle pack的优缺点是什么(相对于development和production )? 为了让这更令人困惑,Ryan McGeary的热门博客post名为“Vendor Everything”,仍然适用于运行bundle install –path vendor和echo ‘vendor/ruby’ >> .gitignore和包装gem通过运行bundle package vendor/cache 。 任何与我的其他关注相关的光线都将不胜感激。 谢谢。 -bash> git push production master … —–> Heroku receiving push —–> Ruby/Rails app detected —–> WARNING: Removing `vendor/bundle`. Checking in `vendor/bundle` is not supported. Please remove this […]

Gemfile.lock未签入 – Heroku

在尝试“git push heroku master”时,我不断收到错误消息: Counting objects: 266, done. Delta compression using up to 4 threads. Compressing objects: 100% (239/239), done. Writing objects: 100% (266/266), 222.68 KiB, done. Total 266 (delta 55), reused 0 (delta 0) —–> Heroku receiving push —–> Rails app detected —–> Detected Rails is not set to serve static_assets Installing rails3_serve_static_assets… done […]

在windows上开发,在heroku上运行独角兽

我有一个新的Rails项目,我决定尝试heroku,部署似乎很容易 我在windows上开发,所以运行独角兽不是一个选择,但webrick可以用于开发 但是,当它部署时,我想使用独角兽,而heroku完全支持这一点 问题是:我必须在我的Gemfile上列出独角兽以便heroku选择它,但当我这样做并在我的windows dev机器上运行bundle命令(或rails s)时,它会尝试安装unicorn服务器 我试图把独角兽放在生产组,组:生产做gem’独角兽’结束仍然捆绑抱怨,我无法运行开发服务器

如何将Gems冻结到Rails 3应用程序中?

我想将特定的gem冻结到我的Rails应用程序中。 在rails 2中有这个命令: rake gems:unpack 我在Rails 3中找不到该命令。

在ffi上捆绑更新失败

我正在尝试在我的rails应用程序上进行bundle update ,但是我收到以下错误: Installing ffi (1.0.11) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks! /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/Kyle/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb checking for ffi.h… *** extconf.rb failed […]

捆绑将所选组安装到自定义路径中

作为仅针对所选gem的Bundle部署的后续操作,使用–without选项的黑名单解决方案,例如: group :runtime do gem ‘rails’ … end group :runtime_unpackaged do gem ‘less2sass’ end 可以使用以下命令安装runtime_unpackaged : bundle –path vendor/bundle –without runtime runtime组通过debian软件包安装,因为应用程序本身打包为.deb软件包。 但是,应用程序将不再处理组runtime所有其他gem,因为此命令将创建一个文件.bundle/config ,用于过滤它们。 换句话说,我想使用系统中的gem加载应用程序 – debian jessie包 – (组runtime )以及本地安装在vendor/bundle (group runtime_unpackaged )的gems。