简体   繁体   English

操作系统“Snow Leopard”问题的Mac上的Ruby on Rails和Phusion Passenger

[英]Ruby on Rails and Phusion Passenger on Mac with OS “Snow Leopard” problem

I'm trying to deploy my application using Ruby on Rails and Phusion Passenger on my Mac with OS "Snow Leopard" v10.6.5. 我正在尝试使用Ruby on Rails和Phusion Passenger在我的Mac上使用操作系统“Snow Leopard”v10.6.5部署我的应用程序。 I read lots of guides on the Internet and I got a headache! 我在互联网上阅读了很多指南,我很头疼!

What I did is : 我所做的是

1 . 1。 I installed Passenger as described here . 我按照这里的描述安装了Passenger。

2 . 2。 I edited the '/private/etc/apache2/httpd.conf' file adding these code lines: 我编辑了“ /private/etc/apache2/httpd.conf”文件,添加了以下代码行:

LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-3.0.2
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

3 . 3。 I restarted apache from the "System Preferences" Panel 我从“系统偏好设置”面板重新启动了apache

Info: at this time if I go to 'http://localhost/' in the browser, I get the common page index.html from 'User/< my_user_name >/Sites/' folder. 信息:此时,如果我在浏览器中转到“ http:// localhost /”,则会从“用户/ <my_user_name> / Sites /”文件夹中获取公用页面index.html。 It seems all work. 看来一切正常。

4 . 4。 I copied the folder of my RoR application (< my_ror_application_name> folder within app directory, config directory, config.ru file, ...) in 'User/< my_user_name >/Sites/' 我在'User / <my_user_name> / Sites /'中复制了我的RoR应用程序的文件夹(app目录中的<my_ror_application_name>文件夹,config目录,config.ru文件......)

5 . 5。 I edited the '/private/etc/apache2/httpd.conf' file adding these code lines: 我编辑了'/private/etc/apache2/httpd.conf'文件,添加了以下代码行:

   < VirtualHost *:80 >

      ServerName < my_ror_application_name> .com
      DocumentRoot /Library/WebServer/< my_ror_application_name>/public   

   < / VirtualHost >

6 . 6。 I restarted apache from the "System Preferences" Panel 我从“系统偏好设置”面板重新启动了apache

Now if I go to 'http://localhost/' in the browser, I get the "Impossible to find localhost" alert. 现在,如果在浏览器中转到“ http:// localhost /”,则会收到“找不到本地主机”警报。

I think there is something wrong with the Document root with the step 5 or, maybe, in the public folder of my application... 我认为第5步或我的应用程序的公用文件夹中的文档根目录有问题...

In my RoR application, the public directory have these files and directories: 在我的RoR应用程序中,公共目录包含以下文件和目录:

  • 404.html 404.html
  • 422.html 422.html
  • 500.html 500.html
  • robot.txt robot.txt的
  • images directory 图像目录
  • javascripts directory javascripts目录
  • stylesheets directory 样式表目录

What's wrong?! 怎么了?!

You may want to take a look to passenger pane . 您可能需要查看乘客窗格 For me it works like a charm :) 对我来说,它就像一个魅力:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM