bundler

Does Capistrano need to be in the development group in the Gemfile?

試著忘記壹切 提交于 2019-12-23 09:08:01
问题 In a rails Gemfile, does gem 'capistrano' need to be inside the :development group or this there any advantage in putting it inside an arbitrary group like :tools ? 回答1: Simply put, no, it doesn't need to be, but it's good for the sake of best practices and keeping your gemsets uncluttered. The best way to do that is open for debate, but basically as long as Capistrano is available to you in the environment you're working in, it doesn't matter what groups it is or isn't associated with,

Programmatically check if gem in bundle?

人走茶凉 提交于 2019-12-23 08:53:48
问题 At runtime, after bundler setup is complete, and groups are applied, what is the best way to programmatically check if a given gem_name is in the bundle? By reading the source, I've discovered Bundler.definition, e.g. gem_name = 'banana' Bundler.definition.dependencies.map(&:name).include?(gem_name) but unable to find documentation 1 , I don't know if this is the recommended usage. Update: It looks like Bundler::Definition#dependencies returns all dependencies, irrespective of groups. As an

How Can I Specify A Minimum Ruby Version in a Gemfile?

北城余情 提交于 2019-12-23 07:00:11
问题 I know that I can specify a Ruby version in a Gemfile like so: ruby '2.0.0' However, instead of setting the exact Ruby version, I'd like to be able to specify a minimum Ruby version so that my scripts remain compatible with new version of Ruby. 回答1: Already possible since Bundler 1.12, e.g. ruby "~> 2.3.0" see here: https://github.com/bundler/bundler-features/issues/119 回答2: You could raise an exception instead: raise 'Ruby should be >2.0' unless RUBY_VERSION.to_f > 2.0 来源: https:/

how to install gems for rbenv, using Ansible

对着背影说爱祢 提交于 2019-12-23 05:28:00
问题 Using Ansible, how can I use the gem (or other) module to install a gem (in this case, bundler) such that I can run the following command without error? deployer@boxes-vm:~$ ~/.rbenv/bin/rbenv exec bundle install rbenv: bundle: command not found 回答1: Well, you can always use the bundle from the shims directory command: ${HOME}/.rbenv/shims/bundle install --deployment 来源: https://stackoverflow.com/questions/23133850/how-to-install-gems-for-rbenv-using-ansible

Starting a Thin cluster on Windows

你离开我真会死。 提交于 2019-12-23 05:25:11
问题 I have a ruby app on my machine that I'm trying to deploy with a batch script. I've got everything up to the server handled. This is what I'm using: cd to/path/of/app thin start -p 3001 This works. cd to/path/of/app thin start --servers 3 As per http://code.macournoyer.com/thin/usage/, does not work. I get an error "lib/thin/runner.rb:142:in 'parse!': invalid option: --servers" Any idea why this isn't working? 回答1: On line 88 in lib/thin/runner.rb it says # Daemonizing not supported on

capistrano error msg: Please install the pg adapter: `gem install activerecord-pg-adapter` (cannot load such file --

♀尐吖头ヾ 提交于 2019-12-22 17:10:17
问题 I am using capistrano and get this error message: Please install the pg adapter: `gem install activerecord-pg-adapter` (cannot load such file -- active_record/connection_adapters/pg_adapter) I have removed the gem 'pg' from my Gemfile and bundle install d . I don't see the pg gem in my Gemfile.lock. I have also changed my production db to a sqlite3 adapter. Why is Rails 3.2 / Capistrano / Bundler asking for this? I'm not using it and not in Gemfile.lock and how do I resolve it? I am using

rspec: undefined local variable or method `be_true'

自作多情 提交于 2019-12-22 13:48:31
问题 I am using rspec 2.4.0 and cucumber 0.6.4. I am running a simple scenario (for the sake of this question): Scenario: Simple Test When I test something with step definition: require 'rspec' require 'rspec/expectations' When /^I test something$/ do result = (1==1) result.should be_true end When I run this scenario I get the following problems: undefined local variable or method `be_true' for #<Object:0x1b3b424> (NameError) I am also using bundler to manage my dependencies. Am I doing something

Error installing Nokogiri via Bundler on Windows

送分小仙女□ 提交于 2019-12-22 11:31:52
问题 I'm trying to set up and run the Extreme Startup coding dojo on my Windows machine. When I reach the bundle install step, I get this error message: $ bundle install Fetching gem metadata from https://rubygems.org/............ Fetching version metadata from https://rubygems.org/.. Resolving dependencies... Installing builder 3.2.2 Installing nokogiri 1.4.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. c:/Ruby22-x64/bin/ruby.exe -r ./siteconf20150826

Whenever Gem Fails to Run “bundle exec” Correctly in Capistrano

 ̄綄美尐妖づ 提交于 2019-12-22 10:41:06
问题 I'm having problems deploying the Whenever gem to my production environment using Capistrano. The problem is stemming from a bundle exec whenever command that's triggering some 'missing gem' issues (yet running bundle install from the shell shows that everything is in fact there!). My feeling is that one of two things is happening: that Bundler isn't fully loading before bundle exec is being called, or that somehow there's a path issue that's running it in the wrong place. Here's what's going

Remove development gems from production with Bundler and Rails 4

最后都变了- 提交于 2019-12-22 10:23:39
问题 Problem Our deployed application has development dependencies in it. We have a lot of development dependencies. This increases the artifact size and the memory consumption in production, as all those dependencies are require 'd. Most instances are deployed in the cloud, so more memory = more money for larger instances. We would like to reduce the size/memory and make a more clear separation between the deployed artifact and the development environment. A particular focus is the need for