Bundle Install Not Running from My Post-Update Hook

bundle install not running from my post-update hook

Your hook shell ins't the same than the one you logged in (and which has the proper PATH)

You can try using at the beginning your your hook script:

#!/bin/bash -l

(See this answer

The -l parameter executes the command in a login shell, which means that it inherits your path and other settings from your shell profile.

)

Or you can make sure your script gets the same environment than your current session, by adding in the first lines of your hook:

$ source $HOME/.bash_profile # single user RVM setup
$ source /etc/profile # multi user RVM setup

Or (final alternative) you can add (before calling bundle) (for a single-user rvm installation)

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Bundler-Audit: How to implement post-bundle install hook?

While there may be a better approach, my current solution is to just use a bash function/alias.

Why doesn't the 'bundle install --without production' command not require '--without production' after update?

I believe it's because bundler creates a .bundle/config file inside your project's folder. This file stores the --without production option for later execution so that you don't have to type it every time.

Problem making bundle install in the console when i change from ruby 2.3.7 to ruby 2.5

I faced this problem. I was working on a small project hence I just updated ruby version in gemfile to 2.6.3 and it worked for me.

Bundler Trying To Run Under Wrong Version of Ruby

You need to load RVM functions to the shell script. link
Or just switch to Rbenv :)

How to solve the update bundler warning in rails when deploying to OpenShift?

Typically, running an out-of-date bundler will not cause any issues, so you should be able to safely ignore the Warning.

However, if you must update the version of bundler for some reason, you should use an .s2i/bin/assemble script to update the version of bundler prior to the default build process. So something similar to

#!/bin/bash -e
# The assemble script builds the application artifacts from source and
# places them into appropriate directories inside the image.

echo "---> Updating bundler gem..."
gem install bundler

# Execute the default S2I script
source ${STI_SCRIPTS_PATH}/assemble

should do the trick. If you add this to your repository in the .s2i/bin directory as an executable assemble script (definition don't forget to chmod +x assemble before adding this to your repository), this should take care of the issue for you.

You can also see the default Ruby 2.5 assemble script in the sclorg GitHub repo: https://github.com/sclorg/s2i-ruby-container/blob/master/2.5/s2i/bin/assemble. Just change the version in the URL as needed in case your curious.



Related Topics



Leave a reply



Submit