Skip to content
This repository

Enable bundler if a Gemfile is present. #12

Open
wants to merge 2 commits into from

3 participants

James Harton Gleb Pomykalov Alexey Palazhchenko
James Harton

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.

Gleb Pomykalov
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

Alexey Palazhchenko

This should be in Rakefile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
6  bin/daemonizer
... ...
@@ -1,6 +1,12 @@
1 1
 #!/usr/bin/env ruby
2 2
 require 'rubygems'
3 3
 
  4
+if File.exists? File.join(File.dirname(__FILE__), 'Gemfile')
  5
+  # This project has a Gemfile also, let's require bundler
  6
+  # to make sure our Gem's don't clash.
  7
+  require "bundler/setup"
  8
+end
  9
+
4 10
 $:.unshift(File.dirname(__FILE__) + '/../lib') unless $:.include?(File.dirname(__FILE__) + '/../lib')
5 11
 
6 12
 require File.dirname(__FILE__) + '/../lib/daemonizer'
5  daemonizer.gemspec
@@ -5,7 +5,7 @@
5 5
 
6 6
 Gem::Specification.new do |s|
7 7
   s.name = %q{daemonizer}
8  
-  s.version = "0.4.16"
  8
+  s.version = "0.4.17"
9 9
 
10 10
   s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11 11
   s.authors = ["Gleb Pomykalov"]
@@ -61,17 +61,20 @@ Gem::Specification.new do |s|
61 61
     if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62 62
       s.add_runtime_dependency(%q<thor>, [">= 0.13.7"])
63 63
       s.add_runtime_dependency(%q<simple-statistics>, [">= 0"])
  64
+      s.add_runtime_dependency(%q<bundler>, [">= 1.0.0"])
64 65
       s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
65 66
       s.add_development_dependency(%q<yard>, [">= 0"])
66 67
     else
67 68
       s.add_dependency(%q<thor>, [">= 0.13.7"])
68 69
       s.add_dependency(%q<simple-statistics>, [">= 0"])
  70
+      s.add_dependency(%q<bundler>, [">= 1.0.0"])
69 71
       s.add_dependency(%q<rspec>, [">= 1.2.9"])
70 72
       s.add_dependency(%q<yard>, [">= 0"])
71 73
     end
72 74
   else
73 75
     s.add_dependency(%q<thor>, [">= 0.13.7"])
74 76
     s.add_dependency(%q<simple-statistics>, [">= 0"])
  77
+    s.add_dependency(%q<bundler>, [">= 1.0.0"])
75 78
     s.add_dependency(%q<rspec>, [">= 1.2.9"])
76 79
     s.add_dependency(%q<yard>, [">= 0"])
77 80
   end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.