mirror of
https://github.com/YunoHost-Apps/snweb_ynh.git
synced 2024-09-03 20:26:22 +02:00
Update: ynh_install_ruby__2 script
This commit is contained in:
parent
f4c54892a4
commit
40d878069f
1 changed files with 9 additions and 3 deletions
|
@ -12,6 +12,12 @@ rbenv_install_dir="/opt/rbenv"
|
|||
ruby_version_path="$rbenv_install_dir/versions"
|
||||
# RBENV_ROOT is the directory of rbenv, it needs to be loaded as a environment variable.
|
||||
export RBENV_ROOT="$rbenv_install_dir"
|
||||
export rbenv_root="$rbenv_install_dir"
|
||||
|
||||
ruby_dependencies=""
|
||||
build_ruby_dependencies="libjemalloc-dev curl build-essential libreadline-dev zlib1g-dev libsqlite3-dev libssl-dev libxml2-dev libxslt-dev autoconf automake bison libtool"
|
||||
pkg_dependencies="$pkg_dependencies $ruby_dependencies"
|
||||
build_pkg_dependencies="$build_pkg_dependencies $build_ruby_dependencies"
|
||||
|
||||
# Load the version of Ruby for an app, and set variables.
|
||||
#
|
||||
|
@ -36,9 +42,9 @@ export RBENV_ROOT="$rbenv_install_dir"
|
|||
# Finally, to start a Ruby service with the correct version, 2 solutions
|
||||
# Either the app is dependent of Ruby or gem, but does not called it directly.
|
||||
# In such situation, you need to load PATH
|
||||
# `Environment="__YNH_RUBY_LOAD_ENV_PATH__"`
|
||||
# `Environment="__YNH_RUBY_LOAD_PATH__"`
|
||||
# `ExecStart=__FINALPATH__/my_app`
|
||||
# You will replace __YNH_RUBY_LOAD_ENV_PATH__ with $ynh_ruby_load_path
|
||||
# You will replace __YNH_RUBY_LOAD_PATH__ with $ynh_ruby_load_path
|
||||
#
|
||||
# Or Ruby start the app directly, then you don't need to load the PATH variable
|
||||
# `ExecStart=__YNH_RUBY__ my_app run`
|
||||
|
@ -281,7 +287,7 @@ ynh_cleanup_ruby () {
|
|||
required_ruby_versions="${installed_app_ruby_version}\n${required_ruby_versions}"
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
# Remove no more needed Ruby versions
|
||||
local installed_ruby_versions=$(rbenv versions --bare --skip-aliases | grep -Ev '/')
|
||||
for installed_ruby_version in $installed_ruby_versions
|
||||
|
|
Loading…
Add table
Reference in a new issue