Skip to content

shared(ruby): fix static instructions#898

Open
davlgd wants to merge 1 commit intomainfrom
davlgd-fix-static-ruby
Open

shared(ruby): fix static instructions#898
davlgd wants to merge 1 commit intomainfrom
davlgd-fix-static-ruby

Conversation

@davlgd
Copy link
Copy Markdown
Collaborator

@davlgd davlgd commented Mar 19, 2026

📝 What does this PR do?

This pull request updates the documentation for managing static files and assets in Ruby applications on Clever Cloud. The changes clarify how Rails applications should handle static files and when to use specific environment variables, making the instructions more accurate and easier to follow.

Documentation improvements for static file handling:

  • Clarified that for standard Rails applications using the asset pipeline, STATIC_FILES_PATH and STATIC_URL_PREFIX do not need to be set, as Rails serves assets itself. Emphasized the importance of including assets:precompile in CC_RAKEGOALS.
  • Added instructions for non-Rails Rack applications on how to configure NGINX to serve static files directly using STATIC_FILES_PATH and STATIC_URL_PREFIX, and explained default NGINX behavior if these are not set.

🔗 Related Issue (if applicable)


🧪 Type of Change

  • ⚠️ Bug fix
  • 📅 Changelog update
  • 📚 Documentation update
  • ✨ New content/feature
  • 🔧 Technical/maintenance

✅ Quick Checklist


@davlgd davlgd requested a review from Copilot March 19, 2026 16:41
@github-actions
Copy link
Copy Markdown

:octocat: Preview is deploying...

Please wait while the preview is deploying on Clever Cloud...

ℹ️ Name 🔗 Infos & links
🌱 Deploying commit f2d918c
👁️ Preview Generating preview app...

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Clever Cloud’s Ruby documentation to clarify how static files/assets should be handled, distinguishing standard Rails (asset pipeline) behaviour from cases where NGINX should serve static content directly.

Changes:

  • Clarifies that typical Rails apps using the asset pipeline should not set STATIC_FILES_PATH / STATIC_URL_PREFIX, and should include assets:precompile in CC_RAKEGOALS.
  • Adds guidance for non-Rails Rack apps to configure STATIC_FILES_PATH / STATIC_URL_PREFIX for NGINX static serving.
  • Removes prior notes about STATIC_URL_PREFIX=/ and related static configuration caveats.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +94 to 99
For a standard Rails application using the asset pipeline, you typically do not need to set `STATIC_FILES_PATH` or `STATIC_URL_PREFIX`. Rails serves assets through the application itself. Make sure to include the `assets:precompile` task in the `CC_RAKEGOALS` environment variable value:

```bash
CC_RAKEGOALS="db:migrate, assets:precompile"
```

**Note**: if your project uses `webpacker`, make sure to enable the dedicated build instance option in the **Information** menu of your application in the Clever Cloud console because `webpacker` needs a lot a resources when starting.
If you need NGINX to serve static files directly (for example, for a non-Rails Rack application), configure these [environment variables](#setting-up-environment-variables-on-clever-cloud):

`STATIC_FILES_PATH`: should point to a directory where your static files are stored. The path must be absolute regarding the root of your application.
Comment on lines +104 to 105
`STATIC_URL_PREFIX`: the URL path under which you want to serve static files (for example `/public/`). If not set, NGINX serves common static file extensions automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix ruby static files doc

2 participants