Note that there are some explanatory texts on larger screens.

plurals
  1. POOS X: Development & Production Deployment for RoR with Apache and Passenger
    primarykey
    data
    text
    <p>My head is about to explode from the mangled mess as a result of the following few days <strong>trying</strong> to setup a development environment for Rails, Apache and Passenger.</p> <h2>The questions I have are:</h2> <ol> <li>Do you NEED passenger for a development environment? Can I just develop with pow.cx instead? - <em>I am 99.99% sure the answer is no (you don't use passenger for development), but I need confirmation since I am deeply confused now.</em></li> <li>When I deploy, I only use Passenger for that, correct? I.e. I don't ever touch passenger until I deploy.</li> <li>Is my development environment correct?</li> <li>Production deployment is simply moving a rails application under the effects of Passenger coupled with an Apache VHOST?</li> </ol> <h2>Background (I suggest you read):</h2> <p>It seems that all the information on the web is concerned about explaining things for people who already know what they are doing, rather than explaining in detail how things work it's just a series of installation steps and that has left me extremely confused on the role of things, and how to setup a development environment and deploy a RoR application correctly - so please bear with this long question.</p> <p>For the past 3 days I have been trying to setup a development environment on my Macbook Pro that isn't destroyed by Apple's rediculous limits on Apache installations. I installed a custom Apache install (from bitnami using their ruby stack, since I refuse to use Server.app) so that I can run Apache and upgrade things like PHP to 5.5 easily, and that works fine.</p> <p>I am trying to get into RoR but so far it has been a struggle, and I am about ready to give up.</p> <p>I understand you need Apache to serve Rails applications so that the server can handle requests concurrently rather than one at a time, and that various interfaces for this exist like Thin or whatever; Passenger was highly recommended.</p> <p>I installed Passenger via their instructions and did some hackery to compile it for the Bitnami passenger installation, rather than the default Apache on Mac OS X - and it's working. When I start apache and run: <code>passenger-memory-stats</code> I get results expected from the installation guide, so that tells me passenger is running.</p> <p>However, when I try and deploy a simple hello world Rails application I get a slew of "We're sorry…" or no result at all and just a blank page.</p> <p>I am fairly sure my development environment is correct, everything works except this last bit. I can picture development taking place on a pow.cx server, and once deployment is ready you simply copy the Rails application and configure Apache's VHOST to point to your ready-to-deploy app while Passenger handles the rest, is that correct?</p> <p>I am using PostgresSQL via the Postgress.app, the server works fine and I can connect to it.</p> <p>I have <code>gem 'pg'</code> in my Gemfile.</p> <p>I have already read, and tried every conceivable solution from the following SO questions, but I either get no result or empty logs which is… infuriating to say the least:</p> <ul> <li><a href="https://stackoverflow.com/questions/10513450/were-sorry-but-something-went-wrong-with-rails-apache-passenger">We&#39;re sorry, but something went wrong. - with Rails, Apache, Passenger</a></li> <li><a href="https://stackoverflow.com/questions/7689097/ruby-on-rails-how-can-i-edit-database-yml-for-postgresql">Ruby on Rails: How can i edit database.yml for postgresql?</a></li> <li><a href="https://stackoverflow.com/questions/7304576/how-do-i-set-up-the-database-yml-file-in-rails">How do I set up the database.yml file in Rails?</a></li> <li><a href="https://www.ruby-forum.com/topic/187128" rel="nofollow noreferrer">https://www.ruby-forum.com/topic/187128</a></li> </ul> <p>So with all that said, I am trying to deploy this hello world application (which works on a standard rails server) using the following:</p> <h2>INVOKING APPLICATION VIA:</h2> <pre><code>http://dmarket.local:8081/ </code></pre> <h2>VHOSTS:</h2> <pre><code>&lt;VirtualHost *:8081&gt; PassengerEnabled on RailsEnv production ErrorLog /Applications/rubystack/apache2/htdocs/helloworld/project_error.log CustomLog /Applications/rubystack/apache2/htdocs/helloworld/project_error.log combined ServerName dmarket.local:8081 ServerAlias www.dmarket.local:8081 DocumentRoot "/Applications/rubystack/apache2/htdocs/helloworld/public" PassengerPreStart http://dmarket.local:8081 &lt;Directory "/Applications/rubystack/apache2/htdocs/helloworld/public"&gt; Allow from all Options -MultiViews &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <h2>HOSTS FILE:</h2> <pre><code>127.0.0.1 dmarket.local 127.0.0.1 www.dmarket.local </code></pre> <h2>DATABASE.YML (same for development, test, and production):</h2> <pre><code> adapter: postgresql encoding: unicode host: 127.0.0.1 port: 5432 database: tsujp pool: 5 username: tsujp password: </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload