You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To allow more flexible configuration, Rails allows configuring paths for certain purposes via Rails::Application::Configuration.paths. For example, in my config/environments/production.rb I can write:
This is good because /run on most Linux distributions is mounted using the tmpfs filesystem, which is much faster than a hard drive or even an SSD. The rails server command should obey the settings defined here.
Actual behavior
In railties/lib/rails/commands/server/server_command.rb, the paths for temporary files, cache, and sockets are hardcoded. This occurs in the function create_tmp_directories. Instead of using Rails.root.join, the server command should use Rails::Application.config.paths[dir_to_make].first
Note, however, that this will require defaults to be set for the sockets and cache paths in railties/lib/rails/application/configuration.rb
Is this a breaking change?
I do not think this should break much/anything. The paths configuration do not seem very well advertised and most likely are not used very much. The default path settings come out the same as what is already in use.
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails team are limited, and so we are asking for your help.
If you can still reproduce this error on the 6-0-stable branch or on master, please reply with all of the information you have about it in order to keep the issue open.
Thank you for all your contributions.
As another datapoint, we're currently running into this issue when using the Paketo Ruby Cloud Native Buildpack to build and run certain Rails applications. For security reasons the buildpack does not allow its "run user" to write to application files so this call by Rails ends up failing:
2023-07-20T21:52:22.58-0600[APP/]OUT /layers/paketo-buildpacks_mri/mri/lib/ruby/3.2.0/fileutils.rb:406:in`mkdir': Permission denied @ dir_s_mkdir - /workspace/tmp/pids (Errno::EACCES)<truncated>2023-07-20T21:52:22.58-0600 [APP/] OUT from /layers/paketo-buildpacks_bundle-install/launch-gems/ruby/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/server/server_command.rb:71:in `blockincreate_tmp_directories'
<truncated>
It would be really useful if we could specify an alternative location for these temp directories since there are other writeable paths available to us.
Expected behavior
To allow more flexible configuration, Rails allows configuring paths for certain purposes via
Rails::Application::Configuration.paths
. For example, in myconfig/environments/production.rb
I can write:This is good because
/run
on most Linux distributions is mounted using the tmpfs filesystem, which is much faster than a hard drive or even an SSD. Therails server
command should obey the settings defined here.Actual behavior
In
railties/lib/rails/commands/server/server_command.rb
, the paths for temporary files, cache, and sockets are hardcoded. This occurs in the functioncreate_tmp_directories
. Instead of usingRails.root.join
, the server command should useRails::Application.config.paths[dir_to_make].first
Note, however, that this will require defaults to be set for the sockets and cache paths in
railties/lib/rails/application/configuration.rb
Is this a breaking change?
I do not think this should break much/anything. The paths configuration do not seem very well advertised and most likely are not used very much. The default path settings come out the same as what is already in use.
The text was updated successfully, but these errors were encountered: