Ruby on rails 本地主机:8080未在unicorn中运行
在我的虚拟机ubuntu32中,我安装了nginxRuby on rails 本地主机:8080未在unicorn中运行,ruby-on-rails,ruby,nginx,vagrant,unicorn,Ruby On Rails,Ruby,Nginx,Vagrant,Unicorn,在我的虚拟机ubuntu32中,我安装了nginx http://192.168.11.8/ 显示欢迎nginx!页面 我在vagrant目录中添加了rails应用程序。我已在railapp/config/unicorn.rb中安装了unicorn gem和以下内容 working_directory File.expand_path("../..", __FILE__) 现在当我跑的时候 vagrant@precise32:/vagrant$ bundle exec unicorn -c
http://192.168.11.8/
显示欢迎nginx!页面
我在vagrant目录中添加了rails应用程序。我已在railapp/config/unicorn.rb中安装了unicorn gem和以下内容
working_directory File.expand_path("../..", __FILE__)
现在当我跑的时候
vagrant@precise32:/vagrant$ bundle exec unicorn -c config/unicorn.rb
,它在我的终端中显示以下内容
vagrant@precise32:/vagrant$ bundle exec unicorn -c config/unicorn.rb
I, [2013-11-02T03:53:34.983828 #19364] INFO -- : listening on addr=0.0.0.0:8080 fd=9
I, [2013-11-02T03:53:34.984324 #19364] INFO -- : worker=0 spawning...
I, [2013-11-02T03:53:34.985178 #19364] INFO -- : master process ready
I, [2013-11-02T03:53:34.986044 #19479] INFO -- : worker=0 spawned pid=19479
I, [2013-11-02T03:53:34.986595 #19479] INFO -- : Refreshing Gem list
I, [2013-11-02T03:53:37.303696 #19479] INFO -- : worker=0 ready
然而,当我访问localhost:8080时,它显示“哎呀!Google Chrome无法连接到localhost:8080”
当我运行bundle exec rails时,railsapp在
http://192.168.11.8:3000/
我做错了什么?您需要将nginx设置为侦听端口8080,并将该端口上的请求转发到您的应用程序。查看有关如何设置的信息
希望这有帮助 你是在虚拟机上运行Chrome还是在主机上运行Chrome
localhost
仅在虚拟机内工作,否则您需要使用虚拟机的IP。您是否已将8080配置为文件上的转发?