Skip to content

Loading…

Enable bundler if a Gemfile is present. #12

Closed
wants to merge 2 commits into from

3 participants

@jamesotron

I was having problems with workers not starting because gems were already enabled in the daemonizer environment that conflicted with the Gemfile for my application. This fixes the issue.

@glebpom
Owner

Great, thank you.
Just one suggestion - we can search for Gemfile not only in current directory, but in upper dirs, as it is implemented for Daemonfile (and for Gemfile in bundler)
It is implemented in this commit: f58563f

@AlekSi

This should be in Rakefile.

@jamesotron jamesotron closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 10 additions and 1 deletion.
  1. +6 −0 bin/daemonizer
  2. +4 −1 daemonizer.gemspec
View
6 bin/daemonizer
@@ -1,6 +1,12 @@
#!/usr/bin/env ruby
require 'rubygems'
+if File.exists? File.join(File.dirname(__FILE__), 'Gemfile')
+ # This project has a Gemfile also, let's require bundler
+ # to make sure our Gem's don't clash.
+ require "bundler/setup"
+end
+
$:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
require File.dirname(__FILE__) + '/../lib/daemonizer'
View
5 daemonizer.gemspec
@@ -5,7 +5,7 @@
Gem::Specification.new do |s|
s.name = %q{daemonizer}
- s.version = "0.4.16"
+ s.version = "0.4.17"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Gleb Pomykalov"]
@@ -61,17 +61,20 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<thor>, [">= 0.13.7"])
s.add_runtime_dependency(%q<simple-statistics>, [">= 0"])
+ s.add_runtime_dependency(%q<bundler>, [">= 1.0.0"])
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
s.add_development_dependency(%q<yard>, [">= 0"])
else
s.add_dependency(%q<thor>, [">= 0.13.7"])
s.add_dependency(%q<simple-statistics>, [">= 0"])
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
s.add_dependency(%q<rspec>, [">= 1.2.9"])
s.add_dependency(%q<yard>, [">= 0"])
end
else
s.add_dependency(%q<thor>, [">= 0.13.7"])
s.add_dependency(%q<simple-statistics>, [">= 0"])
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
s.add_dependency(%q<rspec>, [">= 1.2.9"])
s.add_dependency(%q<yard>, [">= 0"])
end
Something went wrong with that request. Please try again.