diff --git a/cookbooks/ey-passenger5/recipes/install.rb b/cookbooks/ey-passenger5/recipes/install.rb index accba7e..2dbc043 100644 --- a/cookbooks/ey-passenger5/recipes/install.rb +++ b/cookbooks/ey-passenger5/recipes/install.rb @@ -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}" @@ -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 @@ -98,4 +101,4 @@ ey_cloud_report "passenger5" do message "Installing Passenger 5 finished" -end \ No newline at end of file +end diff --git a/cookbooks/ey-passenger5/templates/default/app_control.erb b/cookbooks/ey-passenger5/templates/default/app_control.erb index d31c9cc..f4ba2a2 100644 --- a/cookbooks/ey-passenger5/templates/default/app_control.erb +++ b/cookbooks/ey-passenger5/templates/default/app_control.erb @@ -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