简体   繁体   中英

422 Error Rails Asset Pipeline fault on Heroku

We've encountered a 422 when Facebook goes to redirect back to the app. When we go to sign in with facebook, were all set up to the point where the user has to click "go to app". When the user clicks that, they are redirected to an error that says "The change you wanted was rejected. Maybe you tried to access something you didnt have access to."

We have officially transferred over to the live domain from the herokuapp test domain, and are testing all of these little things for correctness. This doesnt work. We have looked into deleting our protect_from_forgery characteristics from all controllers, but this was to no avail. Appears to just be a pipeline issue with the asset precompile. We are close, but cant seem to pinpoint it. Scripts ran are below:

Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       could not connect to server: Connection refused
       Is the server running on host "127.0.0.1" and accepting
       TCP/IP connections on port 5432?

Thanks guys, ScudBomb

Looks like an issue with heroku and the fact that environment vars are not available during the precompile.

Try setting in application.rb (as suggested here ).

config.assets.initialize_on_precompile = false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM