I'v been banging my head for a day with Passenger i开发者_运维知识库nstallation in order to start to serve Ruby on Rails on my RHEL server.
I have Ruby (1.9.2) on Rails (3.0.9) and Passenger (3.0.7) installed with RVM.
Apache configuration:
RailsBaseURI /dev/testpublic
#RackBaseURI /dev
<Directory /var/www/dev/testublic>
Options -MultiViews
</Directory>
I generated the testproject with
rails new . -d mysql
rails generate scaffold Post name:string title:string content:text
rake db:migrate
Then navigating to the test project i get:
A source file that the application requires, is missing.
It is possible that you didn't upload your application files
correctly. Please check whether all your application files are uploaded. A required library may not installed. Please install all libraries that this application requires.
Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.
Error message: no such file to load -- rubygems/path_support Exception class: LoadError Application root: /www/dev/rubytest
Any help or tips would be of help. Thank you!
- RR -
And to answer my own question. This is now solved.
I noticed that my installation of RVM did not complete it self as it should have. There was few read blocks and a missing profile configuration. Here is what I did to fix it:
My RVM was installed as multi-user, so that is why there were issues.
chmod a+rx /usr/local/rvm/ -R
chmod a+r /etc/rvmrc
And to /etc/profile and to my own .basch_profile
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
After this i got a different problem - now passeger was looking for the app on the wrong directory. I have my apache set so that I have all top level directories set as separate files and I can enable / disable like sites-enabled is done.
DocumetRoot on Apache configuration (httpd.conf) was set but pointing towards a subdirectory that is on a different path than where rails app was.
Document root was
DocumentRoot "/var/www/default"
Where as my rails app was located in
/var/www/dev/testpublic
This resulted in passenger looking for the app on directory
/var/www/default/dev/testpublic
After modifying the confic accordingly and tweking my setup so that I could set the DocumetRoot to /var/www/ it started to work.
Hope this helps if someone else runs into similar issue.
- RR
精彩评论