Deploying go webapps to heroku: can't find package issue - heroku

I'm following this tutorial and attempting to deploy a bare-bones Go web app to Heroku, but am having difficulties resolving an error:
remote: -----> Running: godep go install -tags heroku ./...
remote: main.go:7:3: cannot find package "github.com/russross/blackfriday" in any of:
remote: /app/tmp/cache/go1.3.3/go/src/pkg/github.com/russross/blackfriday (from $GOROOT)
remote: /tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/src/bitbucket.gotest/Godeps/_workspace/src/github.com/russross/blackfriday (from $GOPATH)
remote: /tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/src/github.com/russross/blackfriday
remote: godep: go exit status 1
remote:
remote: ! Push rejected, failed to compile Go app
I'm new to Go, so I assume I've screwed up my package structure, but running $GOPATH/bin/godep go install or go install works fine.
Here's the (abbreviated) structure of my go directory:
src
testapp
main.go
github.com
-codegangsta
russross
blackfriday
Thanks.

Fixed the issue by adding my $GOPATH/bin dir to my path.
export PATH=$PATH:$GOPATH/bin
Curious as to why this was necessary, though.

Related

whenever i try to push in Heroku,i get this error ."Cargo, the Rust package manager, is not installed or is not on PATH." how to resolve?

Preparing metadata (pyproject.toml): started
remote: Preparing metadata (pyproject.toml): finished with status 'error'
remote: error: subprocess-exited-with-error
remote:
remote: × Preparing metadata (pyproject.toml) did not run successfully.
remote: │ exit code: 1
remote: ╰─> [6 lines of output]
remote: Checking for Rust toolchain...
remote:
remote: Cargo, the Rust package manager, is not installed or is not on PATH.
remote: This package requires Rust and Cargo to compile extensions. Install it through
remote: the system's package manager or via https://rustup.rs/
remote:
remote: [end of output]
remote:
remote: note: This error originates from a subprocess, and is likely not a problem with pip.
remote: error: metadata-generation-failed
remote:
remote: × Encountered error while generating package metadata.
remote: ╰─> See above for output.
remote:
remote: note: This is an issue with the package mentioned above, not pip.
remote: hint: See above for details.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
You're going to need to use multiple buildpacks, one for Rust and another for Python.
Rust is not officially supported, but several community options exist. Pick one, then configure your application:
Set your application to use the Python buildpack:
heroku buildpacks:set heroku/python
Add your chosen Rust buildpack:
heroku buildpacks:add --index 1 YOUR_CHOSEN_BUILDPACK
Run heroku buildpacks to ensure they are correct. You should see the Rust buildpack first, and the Python buildpack second.
Finally, redeploy your application.

Using babel-polyfill in CRA, cant deploy to heroku

Module not found: Error: Can't resolve 'babel-polyfill' in
'/tmp/build_7f85e1e4173bfdceff6d0abd745c2646/src' remote:
remote: error Command failed with exit code 1. remote:
info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command. remote: remote: -----> Build failed remote:
remote: We're sorry this build is failing! You can troubleshoot
common issues here: remote:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
This is the error I get when I try to deploy my app to heroku.
"babel-polyfill": "^6.23.0",
is in my dependencies (not devDependencies).
I require babel in my index.js file on the first line:
import 'babel-polyfill';
Why cant heroku resolve the babel-polyfill ?

Run knex migration during heroku buildpack

I'm using the meteor buildpack to deploy my meteor app.
I would like to be able to run a migration with knex at the end of the buildpack installation.
I forked the buildpack to add a shell script in the extra directory (as mentioned in the README) that contains: cd .knex && knex migrate:latest --env staging
Unfortunately, there isn't any .knex directory in the buildpack current directory.
I run ls -a during the heroku buildpack to display the content of the current directory and there isn't a .knex directory:
remote: .
remote: ..
remote: app
remote: assets
remote: boot.js
remote: boot-utils.js
remote: config.json
remote: mini-files.js
remote: node_modules
remote: npm
remote: npm-shrinkwrap.json
remote: package.json
remote: packages
remote: program.json
remote: shell-server.js
Any suggestions?
If you have a migrations folder, created initially at the CLI with: knex migrate:make migration_name then you can trigger a migration to the latest within the app itself using: knex.migrate.latest([config]) as per the documentation: http://knexjs.org/#Migrations-latest
The config should be as per a knexfile.js, I followed an example here for reference: http://www.dancorman.com/knex-your-sql-best-friend/

Go: deploy on Heroku

With help of the article I'm trying to deploy Go-lang app to heroku. The problem is I get an error while deploying
-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Installing go1.4... done
Tired of waiting for bzr and hg?
Try github.com/kr/godep for faster deploys.
Installing Virtualenv... done
Installing Mercurial... done
Installing Bazaar... done
-----> Running: go get -tags heroku ./...
go install: no install location for directory /tmp/build_2c4fa2d4b9d0408123831030713fa930/.heroku/g/src outside GOPATH
! Push rejected, failed to compile Go app
What did I miss? Thanks
To fix it you should get Godep
go get github.com/kr/godep
export PATH=$PATH:$GOPATH/bin
after that in project directory
godep save
more information in the artice
Heroku now officially supports Go and has a Getting Started guide and other docs.

Deploying a Go app with Imagemagick on Heroku

I've been trying to deploy a simple Go app with imagick
This requires Imagemagick. I've tried using the multi buildpack to install Imagemagick and run my app. This is how my .buildpack looks like:
https://github.com/mcollina/heroku-buildpack-imagemagick
https://github.com/kr/heroku-buildpack-go.git
And this is the error I see on Heroku:
Fetching repository, done.
Counting objects: 170, done.
Compressing objects: 100% (154/154), done.
Writing objects: 100% (169/169), 170.13 KiB | 0 bytes/s, done.
Total 169 (delta 21), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/mcollina/heroku-buildpack-imagemagick
=====> Detected Framework:
-----> Installing libpng 1.5.14
Download completed
Installation completed
-----> Installing imagemagick 6.8.2-3
Download completed
Installation completed
-----> Building runtime environment for imagemagick
=====> Downloading Buildpack: https://github.com/kr/heroku-buildpack-go.git
=====> Detected Framework: Go
-----> Installing go1.3... done
-----> Running: godep go install -tags heroku ./...
# github.com/gographics/imagick/imagick
error: 'RemoveAlphaChannel' undeclared (first use in this function)
error: 'FlattenAlphaChannel' undeclared (first use in this function)
godep: go exit status 2
! Push rejected, failed to compile Multipack app
To git#heroku.com:philosoraptor-me.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to
I ended up using the image package from Go's excellent standard lib instead of depending on imagemagick.
This also taught me a valuable lesson about looking for a solution as close to the problem as possible than trying to solve it with a tool that I'm most familiar with.
Have you tried updating your local copy of gographics/imagick and doing godep update gographics/imagick ? The error error: 'FlattenAlphaChannel' undeclared seems to be coming from the library and not the buildpack

Resources