summary refs log tree commit diff
path: root/pkgs/development/interpreters/ruby/ruby-2.0.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/interpreters/ruby/ruby-2.0.nix')
-rw-r--r--pkgs/development/interpreters/ruby/ruby-2.0.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/ruby/ruby-2.0.nix b/pkgs/development/interpreters/ruby/ruby-2.0.nix
index 4ad2f8c515e..ae242107b96 100644
--- a/pkgs/development/interpreters/ruby/ruby-2.0.nix
+++ b/pkgs/development/interpreters/ruby/ruby-2.0.nix
@@ -46,7 +46,18 @@ stdenv.mkDerivation rec {
 
   installFlags = stdenv.lib.optionalString docSupport "install-doc";
   # Bundler tries to create this directory
-  postInstall = "mkdir -pv $out/${passthru.gemPath}";
+  postInstall = ''
+    # Bundler tries to create this directory
+    mkdir -pv $out/${passthru.gemPath}
+    mkdir -p $out/nix-support
+    cat > $out/nix-support/setup-hook <<EOF
+    addGemPath() {
+      addToSearchPath GEM_PATH \$1/${passthru.gemPath}
+    }
+
+    envHooks+=(addGemPath)
+    EOF
+  '';
 
   meta = {
     license = "Ruby";