尝试部署rails/react应用程序时,应用程序与buildpack不兼容



我最近在heroku上部署了一个rails应用程序,没有任何问题,但现在我正试图在heroku上部署一个rails/react应用程序,我玩得很开心。有人能帮我指明正确的方向吗?我已经为heroku添加了nodejs和ruby构建包。恐怕我错过了将两个环境连接在一起的东西。这是我目前收到的错误,如果有任何反馈,我将不胜感激。非常感谢。

```remote: -----> Build
remote:        Detected both "build" and "heroku-postbuild" scripts
remote:        Running heroku-postbuild
remote:        
remote:        > gone-fishin-frontend@0.1.0 heroku-postbuild /tmp/build_0df26b25
remote:        > npm run build && npm install
remote:        
remote:        
remote:        > gone-fishin-frontend@0.1.0 build /tmp/build_0df26b25
remote:        > react-scripts build
remote:        
remote:        Creating an optimized production build...
remote:        Compiled successfully.
remote:        
remote:        File sizes after gzip:
remote:        
remote:          63.32 KB  build/static/js/2.b0463501.chunk.js
remote:          2.48 KB   build/static/js/main.61d8b38a.chunk.js
remote:          783 B     build/static/js/runtime-main.44a3a2b0.js
remote:          690 B     build/static/css/main.10cdadf4.chunk.css
remote:        
remote:        The project was built assuming it is hosted at /.
remote:        You can control this with the homepage field in your package.json.
remote:        
remote:        The build folder is ready to be deployed.
remote:        You may serve it with a static server:
remote:        
remote:          npm install -g serve
remote:          serve -s build
remote:        
remote:        Find out more about deployment here:
remote:        
remote:          bit.ly/CRA-deploy
remote:        
remote:        removed 35 packages and audited 1737 packages in 14.177s
remote:        
remote:        71 packages are looking for funding
remote:          run `npm fund` for details
remote:        
remote:        found 0 vulnerabilities
remote:        
remote:        
remote: -----> Caching build
remote:        - node_modules
remote:        
remote: -----> Pruning devDependencies
remote:        removed 35 packages and audited 1737 packages in 12.724s
remote:        
remote:        71 packages are looking for funding
remote:          run `npm fund` for details
remote:        
remote:        found 0 vulnerabilities
remote:        
remote:        
remote: -----> Build succeeded!
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to gonefishin-frontend.
remote: 
To https://git.heroku.com/gonefishin-frontend.git```

这是我的包.json

```{
"name": "gone-fishin-frontend",
"version": "0.1.0",
"private": true,
"engines": {
"npm": "6.14.6",
"node": "14.5.0"
},
"proxy": "http://localhost:3001",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.3",
"redux": "^4.0.5",
"redux-thunk": "^2.3.0",
"styled-components": "^5.1.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"deploy": "cp -a client/build/. public/",
"heroku-postbuild": "npm run build && npm install",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
```
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure

请参阅Heroku文章链接。

您可以在这里找到Rubydetect脚本。

您的项目与Ruby构建包不兼容,因为它在git repo的根目录中缺少Gemfile

相关内容

最新更新