I have ruby and the gems installed within /home/insane-36/.rvm directory. I installed the passenger gem and created passenger.load and passenger.conf files within apache mod-available and enabled the mod for apache. The content of these files are as;
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
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
Then, I created a symlink for the application at location /home/insane-36/www/testing to /var/www/testing. I also created a file to enable the site as;
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName testing
DocumentRoot /var/www/testing/public/
<Directory /var/www/testing/public/>
Options Indexes +ExecCGI FollowSymLinks
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Then enabled the site and restarted the server but it gives me error saying ruby (rack) application could not be started. I kept on searching the internet and found some solutions but none work to me. I think this is permission issue. I dont know what the permission should be set. I guess the files should be made available to the apache user. And tried modifying the permission but instead have the same error. The detailed log is as;
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:
cannot load such file -- rubygems/path_support
Exception class:
LoadError
Application root:
/var/www/testing
Backtrace:
# File Line Location
0 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb 395 in `paths'
1 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb 416 in `path'
2 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 382 in `dirs'
3 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 267 in `_all'
4 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 410 in `each'
5 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 442 in `find'
6 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb 442 in `find_by_path'
7 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb 206 in `try_activate'
8 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 59 in `rescue in require'
9 /home/insane-36/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb 35 in `require'
10 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/utils.rb 241 in `prepare_app_process'
11 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb 156 in `block in initialize_server'
12 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/utils.rb 572 in `report_app_init_status'
13 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb 154 in `initialize_server'
14 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 204 in `start_synchronously'
15 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 180 in `start'
16 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/rack/application_spawner.rb 129 in `start'
17 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 253 in `block (2 levels) in spawn_rack_application'
18 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add'
19 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 246 in `block in spawn_rack_application'
20 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 82 in `block in synchronize'
21 prelude> 10:in `synchronize'
22 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'
23 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application'
24 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application'
25 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application'
26 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop'
27 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously'
28 /home/insane-36/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/helper-scripts/passenger-spawn-server 99 in `'
Any help would be appreciated.
gem uninstall ...
, and then install Bundler and then use it to install the gems viabundle install --binstubs --path vendor
. That will place all the gems in PROJECT_DIR/vendor, so you won't have to change permissions or anything like that. Then see if the error is still occurring. I occassionally get frustrated using Bundler, but it's perfect for this kind of situation. – iainbin/
e.g.bin/rails s
, it helps to prevent clashes with gems on other projects (along with using RVM). – iain