任何人都有使用太阳黑子宝石的工头宝石(从1命令加载你的佣金任务和守护神)的问题?我总是要手动启动太阳黑子,因为Foreman确实说它加载它但不是
始终必须手动运行此命令才能启动sunspot/solr:
bundle exec rake sunspot:solr:start
Run Code Online (Sandbox Code Playgroud)
有谁知道如何让它加载真正的工头?
我成功地让我的应用程序在foreman上运行得很好,但是一旦我将它部署到Heroku,就会在日志中抛出错误:
2012-08-20T03:22:48+00:00 heroku[web.1]: Starting process with command `node index.js`
2012-08-20T03:22:49+00:00 app[web.1]: Server has started.
2012-08-20T03:22:49+00:00 heroku[web.1]: Error R11 (Bad bind) -> Process bound to port 15134, should be 52717 (see environment variable PORT)
2012-08-20T03:22:49+00:00 heroku[web.1]: Stopping process with SIGKILL
2012-08-20T03:22:51+00:00 heroku[web.1]: Process exited with status 137
2012-08-20T03:22:51+00:00 heroku[web.1]: State changed from starting to crashed
Run Code Online (Sandbox Code Playgroud)
我试图更改它绑定的端口,但每次我更改端口.我的应用程序中还有其他错误吗?
当我在本地运行foreman start时 - 我没有得到来自静态的admin css加载...
但当它推动远程它的所有工作按预期!卫生署.
我希望我当地的工头模仿我的远程实例......
继承我当前的settings.py静态内容:(有人可以帮忙吗?)
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://media.lawrence.com/static/"
STATIC_URL = '/static'
# Additional locations of static files
STATICFILES_DIRS = (
os.path.join(PROJECT_DIR, 'static'),
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = …Run Code Online (Sandbox Code Playgroud) 当运行工头开始时,我看到以下消息
> foreman start
20:38:55 web.1 | started with pid 3896
20:38:55 web.1 | Development
20:38:56 web.1 | connect.multipart() will be removed in connect 3.0
20:38:56 web.1 | exited with code 1
20:38:56 system | sending SIGKILL to all processes
Run Code Online (Sandbox Code Playgroud)
我想知道为什么会这样,因为运行node server.js似乎没有终止服务器.
以下代码段似乎导致应用程序以退出代码1终止:
var app = express();
app.configure(function()
{
// More config things above
app.use(express.bodyParser()); // This line is causing the issue
// More config things below
}
Run Code Online (Sandbox Code Playgroud)
以上是使用Express.js框架的代码.删除对express.bodyParser()的上述调用允许服务器运行(通过foreman).问题是,我需要身体解析器模块来解析我传入的get/posts请求.
对此问题的任何帮助将不胜感激.
我能找到的唯一错误就是看 dmesg
[ 603.598951] init: thx4-web-1 main process ended, respawning
[ 603.607935] init: thx4-web-1 main process (3901) terminated with status 127
[ 603.607988] init: thx4-web-1 main process ended, respawning
[ 603.616866] init: thx4-web-1 main process (3903) terminated with status 127
[ 603.616917] init: thx4-web-1 respawning too fast, stopped
Run Code Online (Sandbox Code Playgroud)
操作系统:Debian 7,chruby(2.1.2),新贵(1.6.1-1)和领班(0.74.0)
只有一个进程,以简化Procfile.staging中的调试过程:
web: RAILS_ENV=staging bundle exec puma -e staging -C config/puma.rb
Run Code Online (Sandbox Code Playgroud)
工头生成的文件:
# /etc/init/thx4.conf
start on runlevel [2345]
stop on runlevel [!2345]
# /etc/init/thx4-web.conf
start on starting thx4
stop on stopping …Run Code Online (Sandbox Code Playgroud) 使用时rails s,当代码更改时,rails 会重新加载这些文件,因此我不需要再次停止并启动服务器。
使用foreman viaforeman start -p 3000测试后台worker时,每次修改他们的代码,都需要重启foreman。
有没有办法用工头自动重新加载代码?
我尝试使用工头安装程序与工头一起安装木偶。它使用 ruby 版本 2.0,之后我安装了 r10k,它需要 ruby 版本 >2.3。所以我使用 gems 更新了 ruby,之后我的工头停止了工作。任何解决方案将不胜感激。
我安装了Foreman gem,以便每次运行我的应用程序时启动Sunspot:
Procfile:
search: bundle exec rake sunspot:solr:start
Run Code Online (Sandbox Code Playgroud)
这是输出:
alex@alex-K43U:~/rails/inkleak$ foreman start
08:05:09 search.1 | started with pid 5278
08:05:35 search.1 | java version "1.6.0_24"
08:05:35 search.1 | OpenJDK Runtime Environment (IcedTea6 1.11.5) (6b24-1.11.5-0ubuntu1~11.10.1)
08:05:35 search.1 | OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
08:05:35 search.1 | Removing stale PID file at /home/alex/rails/inkleak/solr/pids/development/sunspot-solr-development.pid
08:05:35 search.1 | Successfully started Solr ...
08:05:35 search.1 | exited with code 0
08:05:35 system | sending SIGTERM to all processes
SIGTERM received
Run Code Online (Sandbox Code Playgroud)
可能是什么问题呢?
(顺便说一句,当我这么做时,太阳黑子运行得很好 …
我即将使用工头在生产中使用upstart导出来开始一些无限的rake任务.
我简陋的"守护进程"就像这样简单:
task magic: :environment do
loop do
make_stuff_happen
sleep 10
end
end
Run Code Online (Sandbox Code Playgroud)
我想知道工头是否在被要求重启时不会直接杀死进程(例如,capistrano deploy),因为我不希望因此而发生任何损坏的操作.
如果是这样,如何预防呢?
我已经使用带有Digital ocean的Ubuntu服务器在VPS上成功部署了rails应用程序.我正在使用工头启动许多进程,我可以启动我的foreman服务器,foreman start如果我ssh到我的服务器但是当我关闭终端时所有进程都停止.如何让它在后台连续运行?
提前致谢.
foreman ×10
heroku ×3
node.js ×2
sunspot ×2
capistrano ×1
django-admin ×1
express ×1
git ×1
javascript ×1
open-source ×1
puppet ×1
r10k ×1
ruby ×1
rubygems ×1
upstart ×1