Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-bash: ngrok: command not found

I'm trying to integrate the Twilio API into my Rails app. The tutorial I found suggested using ngrok to put my app on the internet (rather than working on localhost). I've installed and upnzipped ngrok, and when I try to call it from the directory it is in, I get:

-bash: ngrok: command not found.

Does anyone know what my problem might be? Also could anyone explain what ngrok does vs deploying to heroku? If heroku would work the same, I would just do that. I'm new to using APIs, though, so I'm not clear on why I'm using ngrok.

Thanks!

like image 837
Lauren F Avatar asked Oct 19 '14 16:10

Lauren F


People also ask

How do I start Ngrok on Mac?

If you set up ngrok so it runs from a specific folder, then you must be in the folder where you placed ngrok and use the command ./ngrok http 3000 . Start your server for your project to listen on the same port. You will be able to access your work using the public address provided by ngrok.

What is Ngrok token?

Ngrok is a useful utility to create secure tunnels to locally hosted applications using a reverse proxy. It is a utility to expose any locally hosted application over the web.

How do I update Ngrok?

Upgrading the ngrok Agent Configuration File If you configure ngrok to start with a configuration file, the ngrok agent v3 makes it extremely easy to upgrade by providing the ngrok config upgrade command. Running this command will automatically migrate your configuration file to the latest format.


2 Answers

If the binary is not located in one of the folders stored in the environment variable $PATH you have to provide at least a relative path to your current location. So if you are in the same folder as the binary then you have to call it with ./ngrok

like image 80
Rambo Ramon Avatar answered Oct 18 '22 21:10

Rambo Ramon


To access from any directory I had to move the binary to $PATH

mv ngrok /usr/local/bin 

in order to call executable from everywhere.

UPDATE: brew install ngrok no longer works because:

Error: No available formula with the name "ngrok"
Upstream sunsetted 1.x in March 2016 and 2.x is not open-source.

So you'll need to download binary from https://ngrok.com/download

As for question "What does ngrok do vs Heroku?", ngrok is totally different than Heroku, which is more complex. Ngrok allows you to expose a running local server over the internet using a secure tunnel. Heroku is a cloud hosting platform for web applications. To use ngrok you can just run your local server and expose it via ngrok. Anyone who connects via ngrok to your server is actually communicating to a server running you YOUR local machine. With Heroku, your application is running on hosted virtual machines in the cloud. That is an oversimplification, but in short, NGROk is good for very fast testing of your server by some remote users. It can also be useful for transferring files / data etc. from inside a virtualized environment i.e. a cloud ssh session.

like image 25
lacostenycoder Avatar answered Oct 18 '22 21:10

lacostenycoder