Ruby on Rails Tuesday, June 24, 2014



Thanks! I will try and see if I can figure it out, I use rbenv to manage ruby versions.

Best,
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/31edd7c9-1ac5-43dd-abd3-378b04e0b121%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment