pow.cx 由于 rails ruby 中的 .envrc 文件无法正常工作

pow.cx not working due to .envrc file in ruby on rails

我正在尝试 运行 pow server,但当它在 rails 应用程序的 ruby 的根目录中看到 .envrc 文件时它停止了。我该如何解决这个问题?

这是一个known issue, which will occur for many rails users as the spring gem advises the use of a .envrc file that in used by direnv. The solution as described here是将.envrc文件的内容包裹起来如下:

if [ "$(type -t direnv_load)" = 'function' ]; then
  # Whatever you want only direnv to execute
fi

顺便说一句,您可能需要更改 config/development.rb 文件,以便

config.asset_host = 'myapp.dev

然后需要通过

重新启动应用程序
touch tmp/restart.txt