3

I'm trying to make a simple tcp/ip server run on Heroku (along with my Ruby on Rails app).

I've added the Ruppels socket addon and installed socket-connect submodule as described in this tutorial.

I added the following line in my Procfile:

web: ./lib/sockets-connect/rs-conn ./app/test.rb -b $PORT

When I run run the app on heroku, I get the following results:

heroku[web.1]: Starting process with command `./lib/sockets-connect/rs-conn ./app/test.rb -b 5323`
app[web.1]: ./lib/sockets-connect/rs-conn: line 157: kill: (6) - No such process
app[web.1]: Connecting tcp://localhost:1337/ to tcp://43954.9252e573-db51-404e-8e27-b444e8981e0a.sockets.ruppells.io:43954/... done
app[web.1]: Running ./app/test.rb -b 5323... done
app[web.1]: ./lib/sockets-connect/rs-conn: line 152: ./app/test.rb: Permission denied
heroku[web.1]: State changed from starting to crashed

Am I declaring the wrong port? Why do I get a permission denied error?

I already tried to change the permission of the ruby file to 755.

Jonast92
  • 4,964
  • 1
  • 18
  • 32
bjarkig82
  • 558
  • 4
  • 13

2 Answers2

3

Could this be that you are opening port 80 and you are not running as a user that can open port 80. Can you try as root or a privileged user?

Ólafur Waage
  • 68,817
  • 22
  • 142
  • 198
  • Thank you for you anwser. The app should not be listhening to port 80 and the user should have privaleges to run this. I tried creating a standalone app (not including the rail enviroment) and that worked fine... Will report back if I get any closer :-) – bjarkig82 Jan 23 '15 at 22:27
1

I finally found out what was going wrong with my app. I created a bin folder in my and moved test.rb to that folder. Then changed the line in th procfile to:

web: ./lib/sockets-connect/rs-conn ./bin/test.rb -b $PORT

Now the server runs smoothly :)

bjarkig82
  • 558
  • 4
  • 13