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
I ran into a build failure when attempting to deploy a new Rails API to Railway using the railway up command.
It appears that the build fails when it tries to run this rake task assets:precompile
This is because when you create a rails project with the --api flag it skips all the views, assets, etc. as outlined in the Rails docs here, so the assets:precompile task does not exist.
It looks like you're looking within the config/application.rb file. Perhaps you can add some logic to look for the config.api_only = true line and adjust the build settings based on that.
To reproduce
In the Railway dashboard, create a new empty project
On your local machine, create a new rails API with a postgres db rails new my_api --api --database=postgresql
Create and migrate the db rails db:{create,migrate}
Back in the Railway dashboard click the button at the bottom to set up your project locally
Copy the Railway link to connect to the Railway project and paste it into your terminal
Run railway up
Expected behavior
I would expect the build to succeed.
Environment
MacOS 12.3.1
ruby 3.2.0
rails 7.0.4
The text was updated successfully, but these errors were encountered:
I've not ever used Rust before and don't know how complicated this would be to fix, but I'd be happy to try and submit a PR if this is a rails feature you want to support.
Is there an existing issue for this?
Describe the bug
I ran into a build failure when attempting to deploy a new Rails API to Railway using the
railway up
command.It appears that the build fails when it tries to run this rake task
assets:precompile
This is because when you create a rails project with the
--api
flag it skips all the views, assets, etc. as outlined in the Rails docs here, so theassets:precompile
task does not exist.I think this is the function that probably needs to be updated
It looks like you're looking within the
config/application.rb
file. Perhaps you can add some logic to look for theconfig.api_only = true
line and adjust the build settings based on that.To reproduce
rails new my_api --api --database=postgresql
rails db:{create,migrate}
railway up
Expected behavior
I would expect the build to succeed.
Environment
MacOS 12.3.1
ruby 3.2.0
rails 7.0.4
The text was updated successfully, but these errors were encountered: