heroku

Node.js port issue on Heroku cedar stack

こ雲淡風輕ζ 提交于 2019-12-28 13:22:11
问题 I'm running a basic Express app in Node.js and trying to deploy to Heroku. The app works fine locally and I believe my setup with Heroku has gone well up until starting the server where i get the following error: 2011-09-21T16:42:36+00:00 heroku[web.1]: State changed from created to starting 2011-09-21T16:42:39+00:00 app[web.1]: Express server listening on port 3000 in production mode 2011-09-21T16:42:40+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 3000, should be 12810

foreman only shows line with “started with pid #” and nothing else

徘徊边缘 提交于 2019-12-28 08:09:09
问题 When I run foreman I get the following: > foreman start 16:47:56 web.1 | started with pid 27122 Only if I stop it (via ctrl-c) it shows me what is missing: ^CSIGINT received 16:49:26 system | sending SIGTERM to all processes 16:49:26 web.1 | => Booting Thin 16:49:26 web.1 | => Rails 3.0.0 application starting in development on http://0.0.0.0:5000 16:49:26 web.1 | => Call with -d to detach 16:49:26 web.1 | => Ctrl-C to shutdown server 16:49:26 web.1 | >> Thin web server (v1.3.1 codename Triple

How to reset Heroku app and re-commit everything?

旧城冷巷雨未停 提交于 2019-12-28 07:39:11
问题 I'm building an application which I'm also testing in Heroku. I ran into some problem today and had to rollback one commit in my local git repo, but Heroku now won't recognize my changes saying that "everything is up to date". So, running git push heroku master heroku responds with Everything up-to-date which isn't true. UPDATE: Things I've tried git push -f heroku master git push --force heroku master git push heroku +master git push --force heroku +master Did some changes in the source code

Return a grouped list with occurrences using Rails and PostgreSQL

雨燕双飞 提交于 2019-12-28 07:15:09
问题 I have a list of Tags in my rails application which are linked to Posts using Taggings . In some views, I'd like to show a list of the 5 most commonly used tags, together with the times they have been tagged. To create a complete example, assume a table with 3 posts: POSTS ID | title 1 | Lorem 2 | Ipsum 3 | Dolor And a table with 2 Tags TAGS ID | name 1 | Tag1 2 | Tag2 Now, if Post 1 is tagged with Tag1 and post 2 is tagged with tags 1 and 2, our taggings table looks like this: TAGGINGS tag

Get client's real IP address on Heroku

萝らか妹 提交于 2019-12-28 02:48:09
问题 On Heroku Cedar, I wanted to get the client's IP. First attempt: ENV['REMOTE_ADDR'] This does not work, of course, because all requests are passed through proxies. So the alternative was to use: ENV['HTTP_X_FORWARDED_FOR'] But this is not quite safe, is it? If it contains only one value, I take this. If it contains more than one value (comma-separated), I could take the first one. But what if someone manipulates this value? I cannot trust ENV['HTTP_X_FORWARDED_FOR'] as I could with ENV[

Long running delayed_job jobs stay locked after a restart on Heroku

[亡魂溺海] 提交于 2019-12-28 02:39:11
问题 When a Heroku worker is restarted (either on command or as the result of a deploy), Heroku sends SIGTERM to the worker process. In the case of delayed_job , the SIGTERM signal is caught and then the worker stops executing after the current job (if any) has stopped. If the worker takes to long to finish, then Heroku will send SIGKILL . In the case of delayed_job , this leaves a locked job in the database that won't get picked up by another worker. I'd like to ensure that jobs eventually finish

heroku 部署 Spring Boot 项目

假如想象 提交于 2019-12-28 00:48:56
首先创建一个空的 Spring Boot 项目,修改启动类 SpringBootHerokuApplication 如下 package io . arukas ; import org . springframework . boot . SpringApplication ; import org . springframework . boot . autoconfigure . SpringBootApplication ; import org . springframework . web . bind . annotation . GetMapping ; import org . springframework . web . bind . annotation . RestController ; @RestController @SpringBootApplication public class SpringBootHerokuApplication { public static void main ( String [ ] args ) { SpringApplication . run ( SpringBootHerokuApplication . class , args ) ; } @GetMapping ( "" ) public String

What does “./bin/www” do in Express 4.x?

走远了吗. 提交于 2019-12-27 12:38:39
问题 I just started to learn about Express 4.0 in my Node.js app, and I found that it generated ./bin/www file, on which only the application server and port settings are written and everything others like middleware and routing is defined in ./app.js file. However, I'm not sure what this ./bin/www does. I've used Express 3.x and I have always defined server and port settings as well as routing and middleware on the identical ./app.js file, and launched my node app with node app.js . So what's the

Should I check in node_modules to git when creating a node.js app on Heroku?

独自空忆成欢 提交于 2019-12-27 10:31:10
问题 I followed the basic getting started instructions for node.js on Heroku here: https://devcenter.heroku.com/categories/nodejs These instruction don't tell you to create a .gitignore node_modules, and therefore imply that node_modules should be checked in to git. When I include node_modules in git my getting started application ran correctly. When I followed the more advanced example at: https://devcenter.heroku.com/articles/realtime-polyglot-app-node-ruby-mongodb-socketio https://github.com

Should I check in node_modules to git when creating a node.js app on Heroku?

霸气de小男生 提交于 2019-12-27 10:30:33
问题 I followed the basic getting started instructions for node.js on Heroku here: https://devcenter.heroku.com/categories/nodejs These instruction don't tell you to create a .gitignore node_modules, and therefore imply that node_modules should be checked in to git. When I include node_modules in git my getting started application ran correctly. When I followed the more advanced example at: https://devcenter.heroku.com/articles/realtime-polyglot-app-node-ruby-mongodb-socketio https://github.com