heroku push error: “Could not detect rake tasks”

后端 未结 10 1220
离开以前
离开以前 2020-12-04 01:19

I\'m trying to deploy a basic app and it\'s not working. Using

git push heroku master 

I got this error message:

remote:          


        
10条回答
  •  孤城傲影
    2020-12-04 01:58

    "Any failure in asset compilation will now cause the push to fail. For Rails 5 asset pipeline support see the Ruby Support page."

    The Rails asset pipeline provides an assets:precompile rake task to allow assets to be compiled and cached up front rather than compiled every time the app boots. There are two ways you can use the asset pipeline on Heroku. Compiling assets locally. Compiling assets during slug compilation.

    To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated.

    Before you can compile your assets on Heroku, you’ll need to be able to compile them locally, run this command to debug your assets:

    RAILS_ENV=production bundle exec rake assets:precompile
    

    This should complete with no errors. Do NOT check in the assets into git after running this command if using Rails 3 as per Heroku's documentation.

    A public/assets directory will be created. Inside this directory you’ll find a manifest.yml which includes the md5sums of the compiled assets in Rails 3. In Rails 4 the file will be manifest-.json. Adding public/assets to your git repository will make it available to Heroku.

    git add public/assets
    git commit -m "vendor compiled assets"`
    

    Now when pushing, the output should show that your locally compiled assets were detected:

    -----> Preparing Rails asset pipeline
       Detected manifest.yml, assuming assets were compiled locally
    

    More help can be found here

    And here

提交回复
热议问题