Ruby on Rails Friday, June 27, 2014


Hi, Jim:

I followed your advice, still couldn't get my site running. Do you set up your rails project in
Mac OSX Mavericks? It seems from its instruction, /etc/apache2/httpd.conf is
/Library/Server/Web/Config/apache2/httpd_server_app.conf
Wonder anyone here has luck setting up rails app in Mac OSX Mavericks.

Thanks!
Liz

On Tuesday, June 24, 2014 10:11:30 AM UTC-4, Jim wrote:

and couldn't display http://localhost/most/rannumgenerator/index     (rannumgenerator is controller I generated in most project).

Wonder if something that I should do for Mac Mavericks or some setting for Apache that I am not aware?

You may need to look in your error log (probably in /var/log/apache2/) for more details on what happened to Passenger.  Also, I've never tried accessing Rails projects under a subdirectory like that, you may need to see if you need to set up something specifically to handle that.

I set my system up quite a bit differently to easier support working on different projects.  First, since Mac OS updates can overwrite http.conf, I put my custom config in the /etc/apache2/other/ directory, broken up into separate files.  So, I have a passenger.conf file and a vhosts.conf file.  I create entries in /etc/hosts to set up local domain names for my various projects.  So I end up with something like this:

/etc/hosts:
127.0.0.1       my.greatproject.local

/etc/apache2/other/passenger.conf:

LoadModule passenger_module /Users/jcrate/.rvm/gems/ruby-2.1.2@global/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /Users/jcrate/.rvm/gems/ruby-2.1.2@global/gems/passenger-4.0.45
  PassengerDefaultRuby /Users/jcrate/.rvm/gems/ruby-2.1.2@global/wrappers/ruby
</IfModule>


/etc/apache2/other/vhosts.conf:

<VirtualHost *:80>
    ServerName my.greatproject.local
    DocumentRoot /path/to/project/public

    RackEnv development

    PassengerRuby /Users/jcrate/.rvm/gems/ruby-2.1.2@myproject/wrappers/ruby
</VirtualHost>


If you're not using RVM, then your passenger-related paths will look a little different.  However, if you have more than one Rails project, you probably want to be using RVM or some sort of ruby version manager.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/067d6418-2040-4f63-b5fb-cb41ff90ca22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment