Why is this permissions error occurring with mod_passenger.so?
It turned out to have to do with SELinux.
The Passenger docs discuss it here.
After you install Passenger, find the Passenger root...
passenger-config --root
Then run this...
chcon -R -h -t httpd_sys_content_t /path-to-passenger-root
Ruby (Rack) application could not be started error
This is how I deployed the application locally.
sudo gem install passenger
sudo apt-get install apache2-dev libapr1-dev libaprutil1-dev
sudo passenger-install-apache2-module
/etc/apache2/mods-available/passenger.load
LoadModule passenger_module /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
/etc/apache2/mods-available/passenger.conf
PassengerRoot /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
PassengerRuby /home/insane-36/.rvm/wrappers/ruby-1.9.3-p194/ruby
Now, enabled the mod-passenger for apache as;
> sudo a2enmod passenger
Created a rails application inside /home/insane-36/www/
rails new testing -T -D mysql
Created a symlink to the application in the /var/www/ folder as;
ln -s /home/insane-36/www/testing /var/www/testing
Created a file in /etc/apache2/sites-available/testing
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName testing
DocumentRoot /var/www/testing/public/
<Directory /var/www/testing/public/>
Options Indexes +ExecCGI FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Enabled the site using,
sudo a2ensite testing
Added the ServerName chosen for and Created a file in /etc/apache2/sites-available/testingthe site to the /etc/hosts file;
testing 127.0.0.1
NOTE:
Be sure to enable the permission 755 to the current user directory.
chmod 755 /home/insane-36
bundle exec rake assets:precompile to compile your assets periodically.
I still have a problem here. I have managed to make the application work. But, everytime I make changes to the application, I need to reload the server. Is there some ways to deal with this so that server automatically tracks the files being changes then reload the server or combine the changes.
Some notes suggested if I added empty file tmp/restart.txt should work for restarting the app and bring the changes but doesnot work for me.
Centos 6.4 - Failed to map segment from shared object: Permission denied
You may refer the following link for Phusion Passenger installation guide.
http://www.modrails.com/documentation/Users%20guide%20Apache.html#installation
Or else execute this command in root to change the security context of “httpd_sys_script_exec_t” which allows Apache to execute.
chcon -R -h -t httpd_sys_script_exec_t /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.33/buildout/apache2/mod_passenger.so
cannot load such file -- bundler/setup (LoadError)
It could be that there was a previous Ruby env installed on your system prior to your installation of 2.0? This might have had an existing GEM_PATH that lead to the /1.8 directory which the installation of version 2.0 simply kept.
The problem you where likely having, then, was that Passenger/Apache was looking in the /2.0 directory when in fact the gems were in the /1.8 directory. Your explicitly telling apache to use the /1.8 directory thus makes sense to fix the problem.
SetEnv GEM_HOME /usr/lib/ruby/gems/1.8
You might also try using the Ruby Version Manager to handle multiple Ruby envs.
Some things I found in Google:
- New to Ruby and am having trouble with LOAD_PATH
- http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices/
- http://guides.rubygems.org/faqs/
Redmine installation
I finally successed to install and run Redmine.
The permission on the database.yml file was correct but not on the parent directory.
Now it works.
Related Topics
Active Admin Scopes for Each Instance of a Related Model
Can't Convert Symbol into String
Running Multiple Background Parallel Jobs with Rails
Customize Error Message with Simple_Form
Rails: Find Rows Without Connection in Habtm Relation
Deploy with Capistrano Failing
How Does Pack() and Unpack() Work in Ruby
Rails: Switch Connection on Each Request But Keep a Connection Pool
How to Find Where a Ruby Method Is Declared
Rails Can't Login to Postgresql - Pg::Error - Password - Correct Info
How to Authorize a Google Service Account Without the Default Credentials File
Find Memory Leak in a Ruby on Rails Project
Using Ruby, Reading a File, Containing Name/Value Pairs into a Hash
Stylesheet_Link_Tag :All Versus :Media =>All
Adding Keywords to Ruby Syntax Highlighting for Notepad++