Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding GEM_PATH to startup script #225

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cookbooks/ey-passenger5/recipes/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
base_port = node["passenger5"]["port"].to_i
stepping = 200
app_base_port = base_port
# For GEM_PATH and others, the major version is needed. I.e: '3.0.0' instead of '3.0.2'
ruby_major_version = node["ruby"]["version"].sub(/(\d\.\d).\d*/, '\1.0')

node.engineyard.apps.each_with_index do |app, index|
app_path = "/data/#{app.name}"
Expand All @@ -59,7 +61,8 @@
version: version,
port: app_base_port,
worker_count: recipe.get_pool_size,
rails_env: framework_env
rails_env: framework_env,
ruby_version: ruby_major_version
)
end

Expand Down Expand Up @@ -98,4 +101,4 @@

ey_cloud_report "passenger5" do
message "Installing Passenger 5 finished"
end
end
3 changes: 3 additions & 0 deletions cookbooks/ey-passenger5/templates/default/app_control.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export HOME="/home/<%= @user %>"
#source "/data/<%= @app_name %>/shared/config/env.custom"
#source "/data/<%= @app_name %>/shared/config/env.cloud"

# Setting the GEM_PATH so that Passenger uses the app's gems
export GEM_PATH="/data/<%= @app_name %>/shared/bundled_gems/ruby/<%= @ruby_version %>/"

cd /data/<%= @app_name %>/

case "$1" in
Expand Down