如何检查Pow在我的Mac上是否正常运行?如何让它正常运行?

时间:2014-12-15 18:30:09

标签: ruby-on-rails rack-pow

我很难从我的浏览器中看到my_proj.dev,我只想检查Pow是否正常运行,或者问题是否在其他地方。什么是快速测试我可以看看Pow是否已正确安装并正常运行?

  1. launchctl list | grep pow提供以下内容:

    451 0   cx.pow.powd
    
  2. ps aux | grep pow提供以下内容:

    jon               451   0.0  0.3  3048228  24300   ??  S    12:38PM   0:00.31 pow
    
  3. curl -H host:pow localhost/status.json提供以下内容:

    curl: (7) Failed to connect to localhost port 80: Connection refused
    
  4. curl -H host:pow localhost:3000/status.jsoncurl localhost:3000/status.json提供以下内容:

    curl: (7) Failed to connect to localhost port 80: Connection refused
    
  5. 更新:

    重新启动我的开发机器显然修复了一切。

3 个答案:

答案 0 :(得分:4)

curl -H host:pow localhost/status.json

您可以点击其他几个端点来从Pow中获取信息。参见:

http://pow.cx/manual.html#section_3.2

答案 1 :(得分:2)

ps aux | grep pow

如果Pow正在运行,应该向您显示至少2个条目。一个标签只是“pow”是粉末过程(另一个应该来自grep命令)。

您始终可以从应用根目录输入touch tmp/restart.txt。这会将应用程序重新加载到pow。

我还建议安装Powder gem来管理应用上的广告。

答案 2 :(得分:0)

对于tmux用户,“pow”从未在tmux下正确安装。 我在这里读到了这个: https://github.com/basecamp/pow/wiki/Troubleshooting#doesnt-start-cant-connect-to-host

我最终通过运行:

卸载了“pow”
curl get.pow.cx/uninstall.sh | sh

然后在新的终端窗口没有“tmux”,我再次安装了“pow”。

curl get.pow.cx | sh

此次安装有效(安装后的“自检”已通过。)

我后来遇到了没有.rvmrc文件的问题(我使用的是.ruby-version和.ruby-gemset,但不知何故“pow”想要一个.rvmrc文件)。

# Change ruby version, gemset, and directory below
cd YOUR_PROJECT_DIRECTORY
echo "rvm ruby-2.2.0@mygemset" >> .rvmrc

最后,在创建.rvmrc文件之后,我不得不在项目目录中创建一个.powrc文件。这是“.powrc”

的内容
if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then
    source "$rvm_path/scripts/rvm"
    source ".rvmrc"
fi