Merge branch '21766-disk-cache-size'
[arvados.git] / lib / boot / passenger.go
index f86f1f930398f48a133cc33fe4752333246b73cb..bf2ca2a78b5c25e8f5652e51ae7260040af98b3c 100644 (file)
@@ -10,6 +10,7 @@ import (
        "fmt"
        "os"
        "path/filepath"
+       "runtime"
        "strings"
        "sync"
 
@@ -83,16 +84,15 @@ func (runner installPassenger) Run(ctx context.Context, fail func(error), super
        if err != nil {
                return err
        }
-       for _, version := range []string{"2.2.19"} {
-               if !strings.Contains(buf.String(), "("+version+")") {
-                       err = super.RunProgram(ctx, appdir, runOptions{}, "gem", "install", "--user", "--conservative", "--no-document", "bundler:2.2.19")
-                       if err != nil {
-                               return err
-                       }
-                       break
-               }
+       err = super.RunProgram(ctx, appdir, runOptions{}, "gem", "install", "--user", "--conservative", "--no-document", "--version", "~> 2.4.0", "bundler")
+       if err != nil {
+               return err
+       }
+       err = super.RunProgram(ctx, appdir, runOptions{}, "bundle", "config", "--set", "local", "path", filepath.Join(os.Getenv("HOME"), ".gem"))
+       if err != nil {
+               return err
        }
-       err = super.RunProgram(ctx, appdir, runOptions{}, "bundle", "install", "--jobs", "4", "--path", filepath.Join(os.Getenv("HOME"), ".gem"))
+       err = super.RunProgram(ctx, appdir, runOptions{}, "bundle", "install", "--jobs", fmt.Sprintf("%d", runtime.NumCPU()))
        if err != nil {
                return err
        }