Я пытаюсь развернуть свое приложение на heroku, но не могу найти способ.В корне у меня есть две папки, «задняя» и «передняя», первая - это приложение rails api, а вторая - приложение реакции.
Я думаю, что с развертыванием реакции все в порядке, а с ruby - нет.У меня есть необходимые пакеты сборки: heroku / nodejs heroku / tuby
Пожалуйста, помогите мне!:)
/ package.json
{
"name": "sophia",
"license": "MIT",
"engines": {
"node": "6.3.1"
},
"scripts": {
"build": "cd front && npm install && npm run build && cd ..",
"deploy": "cp -a front/build/. back/public/",
"postinstall": "npm run build && npm run deploy && echo 'Client built!'"
}
}
Procfile
web: cd front && PORT=3000 npm start
api: cd back PORT=3001 && bundle exec rails s
/ front / package.json
{
"name": "client",
"version": "0.1.0",
"private": true,
"proxy": "http://localhost:3001",
"dependencies": {
"react": "^16.8.4",
"react-dom": "^16.8.4",
"react-scripts": "2.1.8"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Ошибка Heroku
remote: "homepage" :
remote:
remote: The build folder is ready to be deployed.
remote: You may serve it with a static server:
remote:
remote: yarn global add serve
remote: serve -s build
remote:
remote: Find out more about deployment here:
remote:
remote:
remote:
remote:
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Pruning devDependencies
remote:
remote: -----> Build succeeded!
remote: ! Unmet dependencies don't fail npm install but may cause runtime issues
remote: github.com/npm/npm/issues/7494
remote:
remote:
remote: -----> Change to Node.js build process
remote: Heroku has begun executing the "build" script defined in package.json
remote: during Node.js builds.
remote:
remote: Read more: https://devcenter.heroku.com/changelog-items/1573
remote:
remote: -----> App not compatible with buildpack: buildpack-registry.s3.amazonaws.com/buildpacks/heroku/ruby.tgz
remote: More info: devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to sophia-social-network.
remote:
To git.heroku.com/sophia-social-network.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'hgit.heroku.com/sophia-social-network.git'