Die Rails-Entwicklung mit Mongrel beschleunigen
Lösung
$ sudo gem install mongrel
$ mongrel_rails start -d
Ihre Anwendung ist nun an Port 3000 verfügbar, genau wie bei der WEBrick-Standardeinstellung (http://localhost:3000). Um den Server anzuhalten, geben Sie Folgendes ein:
$ mongrel_rails stop
Diskussion
Mongrel ist ein schneller Webserver. Er wurde in Ruby geschrieben (mit einigen C-Erweiterungen). Er ist einfach zu installieren und kann als einfacher Entwicklungsserver dienen. Er kann für größere Produktionsanwendungen aber auch hinter einem Load-Balancer geclustert werden. Mongrel kann auch mit anderen Ruby-Frameworks, wie etwa Og+Nitro und Camping, verwendet werden, ist aber für den Einsatz von Rails-Anwendungen besonders populär. Es ist sehr wahrscheinlich, das script/server in naher Zukunft neben WEBrick und LightTPD auch Mongrel unterstützen wird.
tail -f log/development.log
$ mongrel_rails Usage: mongrel_rails <command> [options] Available commands are: - restart - start - stop Each command takes -h as an option to get help.
$ mongrel_rails start -h Usage: mongrel_rails <command> [options] -e, --environment ENV Rails environment to run as -d, --daemonize Whether to run in the background or not -p, --port PORT Which port to bind to -a, --address ADDR Address to bind to -l, --log FILE Where to write log messages -P, --pid FILE Where to write the PID -n, --num-procs INT Number of processors active before clients denied -t, --timeout TIME Timeout all requests after 100th seconds time -m, --mime PATH A YAML file that lists additional MIME types -c, --chdir PATH Change to dir before starting (will be expanded) -r, --root PATH Set the document root (default 'public') -B, --debug Enable debugging mode -C, --config PATH Use a config file -S, --script PATH Load the given file as an extra config script. -G, --generate CONFIG Generate a config file for -C --user USER User to run as --group GROUP Group to run as -h, --help Show this message --version Show version
$ mongrel_rails_service install -n blog -r c:\data\blog \ -p 4000 -e production
$ mongrel_rails_service start -n blog
Dieses Rezept stammt aus dem Rails Kochbuch, veröffentlicht beim O’Reilly Verlag
Eingestellt am 23.05.2008 um 13:01
Kategorie: Tutorials
Suchen auf rubyonrails.de
Tags
2.0 Action Active-Record ActiveRecord Ajax Buch Capistrano Enterprise Event Formulare Gewinnspiel Grundlagen IDE irb jQuery Kochbuch Konferenz Mac OpenRoRBook OReilly OSX Passenger Phusion Plugin PragProgs Rails Rails 3 RailsWayCon Release Release Candidate Routing Ruby Ruby 1.9 RubyGems rubyonrails.de Ryan Bates Scaffolding Screencast Script-Tip Security Tutorial Upgrade Video Views WindowsAktuelle Artikel
- Rails 3 Release Kandidat veröffentlicht
- Screencast: Controller in Rails 3
- Screencast: Diagramme in Rails Applikationen verwenden
- Screencast: Rails 3 mit Rack
- Screencast: Subdomains in Rails 3
- Rails Magazine 6
- Screencast: PDF Dokumente mit PDFKit generieren
- Screencast: Rails 3 Active Model
- Screencast: Eigene Rails 3 Generatoren erstellen
- Rails 3 Screencastserie von Gregg Pollack (EnvyLabs)
Artikel Archiv
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- May 2009
- April 2009
- March 2009
- February 2009
- December 2008
- November 2008
- August 2008
- July 2008
- June 2008
- May 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
Aktuelle Rails Version + Abhängigkeiten:
rails-2.3.5actionmailer (= 2.3.5, runtime)
actionpack (= 2.3.5, runtime)
activerecord (= 2.3.5, runtime)
activeresource (= 2.3.5, runtime)
activesupport (= 2.3.5, runtime)
rake (>= 0.8.3, runtime)
Rails auf Rubyforge
Rails auf Github