Search code examples
ruby-on-railsnode.jsgitherokureact-on-rails

React on Rails - ! [remote rejected] master -> master (pre-receive hook declined)


I'm working in rails 4.2.5, recently I have added react_on_rails in my app. I am getting the error(mkdir: cannot create directory) when I try to deploy the code on Heroku. App uses couple of webpacks one for Ruby and another for Node.

git push heroku master
Counting objects: 963, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (793/793), done.
Writing objects: 100% (963/963), 982.20 KiB | 0 bytes/s, done.
Total 963 (delta 384), reused 160 (delta 70)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Deleting 18 files matching .slugignore patterns.
remote: -----> Node.js app detected
remote: mkdir: cannot create directory ‘/tmp/build_2116c2c5be27b9852c9d716798b3bcf9/.heroku’: Not a directory
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to acceptance.
remote: 
To https://git.heroku.com/acceptance.git
 ! [remote rejected] master -> master (pre-receive hook declined)

Any help is much appreciated.


Solution

  • Heroku team helped resolve this issue - answer from Heroku team:

    It looks like this project has a ".heroku" file checked into its root directory, which collides with the ".heroku" directory used to install runtimes like node, php, etc. You can keep this file from being pushed to Heroku by adding it to your .slugignore file like this:

    echo ".heroku" >> .slugignore
    
    git commit -am 'ignore .heroku file'