Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running locally on Windows #14

Open
acsbendi opened this issue Oct 6, 2019 · 8 comments
Open

Error when running locally on Windows #14

acsbendi opened this issue Oct 6, 2019 · 8 comments

Comments

@acsbendi
Copy link

acsbendi commented Oct 6, 2019

I'm following the steps described in the README on Windows 10, in git bash, but the last command gives me an error.

Here's my full console output:

$ git clone https://github.com/heroku/go-getting-started.git
Cloning into 'go-getting-started'...
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 1351 (delta 0), reused 0 (delta 0), pack-reused 1347
Receiving objects: 100% (1351/1351), 5.25 MiB | 3.32 MiB/s, done.
Resolving deltas: 100% (541/541), done.
$ cd go-getting-started
$ go build -o bin/go-getting-started.exe -v .
go: downloading github.com/heroku/x v0.0.0-20171004170240-705849e307dd
go: downloading github.com/gin-gonic/gin v0.0.0-20150626140855-4cc2de6207f4
go: extracting github.com/heroku/x v0.0.0-20171004170240-705849e307dd
go: extracting github.com/gin-gonic/gin v0.0.0-20150626140855-4cc2de6207f4
go: downloading github.com/mattn/go-colorable v0.0.0-20150625154642-40e4aedc8fab
go: downloading github.com/manucorporat/sse v0.0.0-20150604091100-c142f0f1baea
go: downloading golang.org/x/net v0.0.0-20150629084131-d9558e5c97f8
go: downloading gopkg.in/bluesuncorp/validator.v5 v5.9.1
go: extracting github.com/mattn/go-colorable v0.0.0-20150625154642-40e4aedc8fab
go: extracting github.com/manucorporat/sse v0.0.0-20150604091100-c142f0f1baea
go: downloading github.com/mattn/go-isatty v0.0.0-20150814002629-7fcbc72f853b
go: extracting gopkg.in/bluesuncorp/validator.v5 v5.9.1
go: extracting github.com/mattn/go-isatty v0.0.0-20150814002629-7fcbc72f853b
go: extracting golang.org/x/net v0.0.0-20150629084131-d9558e5c97f8
go: finding github.com/heroku/x v0.0.0-20171004170240-705849e307dd
go: finding github.com/gin-gonic/gin v0.0.0-20150626140855-4cc2de6207f4
go: finding gopkg.in/bluesuncorp/validator.v5 v5.9.1
go: finding github.com/manucorporat/sse v0.0.0-20150604091100-c142f0f1baea
go: finding github.com/mattn/go-colorable v0.0.0-20150625154642-40e4aedc8fab
go: finding github.com/mattn/go-isatty v0.0.0-20150814002629-7fcbc72f853b
go: finding golang.org/x/net v0.0.0-20150629084131-d9558e5c97f8
github.com/mattn/go-isatty
gopkg.in/bluesuncorp/validator.v5
golang.org/x/net/context
github.com/heroku/x/hmetrics
github.com/manucorporat/sse
github.com/gin-gonic/gin/render
github.com/mattn/go-colorable
github.com/heroku/x/hmetrics/onload
github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin
github.com/heroku/go-getting-started
$ heroku local
[OKAY] Loaded ENV .env File as KEY=VALUE Format
12:13:37 PM web.1 |  'bin' is not recognized as an internal or external command,
12:13:37 PM web.1 |  operable program or batch file.
[DONE] Killing all processes with signal  SIGINT
12:13:37 PM web.1 Exited with exit code null

I have Go 1.13 installed:

$ go version
go version go1.13 windows/amd64
@freeformz freeformz self-assigned this Oct 9, 2019
@freeformz
Copy link
Contributor

Thanks. I'll have to give things a try on a window machine again now that 1.13 is out.

@tempral
Copy link

tempral commented Mar 29, 2020

Alter Procfile so it’s contents are: web: bin\go-getting-started.exe instead of what is in the checkout. Don’t commit changes to Procfile though, otherwise your application’s web process won’t be able to start on Heroku.

@JosiahRoss
Copy link

i am haveing the same problem , i changed it to windows format like you said, it gives me the same error ,

@tempral
Copy link

tempral commented May 5, 2020

I am using an old windows 7 laptop, I have no idea now what cause the error

@freeformz freeformz removed their assignment Jun 7, 2020
@MrUnreal
Copy link

MrUnreal commented Jul 6, 2020

Hey guys (@tempral , @JosiahRoss @freeformz ) - had a brief look at this. In order to make it windows compatible there are 2 changes that I had to make to have this work for me

  1. Command to compile
    go build -o bin/go-getting-started.exe -v .

  2. Change procfile to
    web: bin\go-getting-started.exe

After this it seems to run succesfully
PS E:\Projects\Go\go-getting-started> heroku local [OKAY] Loaded ENV .env File as KEY=VALUE Format 20:39:36 web.1 | [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. 20:39:36 web.1 | - using env: export GIN_MODE=release 20:39:36 web.1 | - using code: gin.SetMode(gin.ReleaseMode) 20:39:36 web.1 | [GIN-debug] GET /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers) 20:39:36 web.1 | [GIN-debug] HEAD /static/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (2 handlers) 20:39:36 web.1 | [GIN-debug] GET / --> main.main.func1 (2 handlers) 20:39:36 web.1 | [GIN-debug] Listening and serving HTTP on :5000

@Kogoruhn
Copy link

If you did everything as described in the @MrUnreal post, but still getting error on heroku local web, then try to run this command in console launched with admin rights.

@edmorley
Copy link
Member

Could someone try with Go 1.17 and main?

@Cori1109
Copy link

I have an issue to deploy gofiber project using heroku.
When I run locally on ubuntu, the same issue happened.

[OKAY] Loaded ENV .env File as KEY=VALUE Format
3:36:32 PM web.1 |  2022/11/25 15:36:32 Connection Opened to Database ✅
3:36:32 PM web.1 |  2022/11/25 15:36:32 Running Migrations
3:36:33 PM web.1 |  2022/11/25 15:36:33 /home/dante/go/pkg/mod/gorm.io/[email protected]/finisher_api.go:509 SLOW SQL >= 200ms
[DONE] Killing all processes with signal  SIGINT
3:36:57 PM web.1 Exited Successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants