Skip to content

Commit

Permalink
Install gems for the rails code in deployment mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Feb 19, 2025
1 parent acdb1a2 commit 8b57637
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions cookbooks/web/resources/rails_port.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,11 +408,25 @@
action :delete
end

directory "#{rails_directory}/vendor/bundle/ruby/#{node[:ruby][:version]}.0" do
owner new_resource.user
group new_resource.group
mode "775"
recursive true
end

bundle_config "#{rails_directory}" do
user new_resource.user
group new_resource.group
settings "deployment" => "true",
"build.nokogiri" => "--use-system-libraries"
end

bundle_install "#{rails_directory}" do
action :nothing
user "root"
group "root"
environment "NOKOGIRI_USE_SYSTEM_LIBRARIES" => "yes"
user new_resource.user
group new_resource.group
subscribes :run, "directory[#{rails_directory}/vendor/bundle/ruby/#{node[:ruby][:version]}.0]"
subscribes :run, "git[#{rails_directory}]"
end

Expand Down

0 comments on commit 8b57637

Please sign in to comment.