http://ihower.idv.tw/blog/archives/1741
http://nubyonrails.com/articles/ask-your-doctor-about-mod_rails
http://duckpunching.com/passenger-mod_rails-for-development-now-with-debugger
http://www.modrails.com/documentation/Users%20guide.html
- Open a terminal, and type:
gem install passenger
- Type:
passenger-install-apache2-module
- /etc/apache2/apache2.conf
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby1.8
RailsEnv development <= development mode, default is production mode - /etc/apache2/sites-available/iwakela
- sudo ln -s /etc/apache2/sites-available/iwakela /etc/apache2/sites-enabled/001-iwakela
- /etc/init.d/apache2 restart/start/stop
- /etc/hosts 127.0.1.1 iwakela.local
# ... bottom of your development.rb
if File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
require 'ruby-debug'
Debugger.wait_connection = true
Debugger.start_remote
File.delete(File.join(RAILS_ROOT,'tmp', 'debug.txt'))
end
# add this rake file to your lib/tasks folder
# File: restart.rake
task :restart do
system("touch tmp/restart.txt")
system("touch tmp/debug.txt") if ENV["DEBUG"] == 'true'
end
rake restart DEBUG=true
rdebug -c
ServerAdmin iwakela@localhost
ServerName iwakela.local
DocumentRoot /home/lake/rails_app/iwakela/public
</virtualhost>
enable debugger
沒有留言:
張貼留言