$rails s 默认启动webrick;
在根目录下直接启动mongrel则会出错:
[t**@localhost posts]$ mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.beta/lib/active_support/dependencies.rb:167:in `require': no such file to load -- dispatcher (LoadError)
.....
google到 在Gemfile 中添加:
gem "mongrel"
gem "cgi_multipart_eof_fix"
gem "fastthread"
gem "experimental"
然后
$ bundle check
$ bundle lock
$ bundle install
[timor@localhost posts]$ bundle check
No compatible versions could be found for required dependencies:
Conflict on: "mongrel":
* mongrel (1.1.6) activated by mongrel (>= 0, runtime)
* mongrel (= 1.1, ) required by mongrel_experimental (>= 0, runtime)
All possible versions of origin requirements conflict.
[timor@localhost posts]$ bundle lock
No compatible versions could be found for required dependencies:
Conflict on: "mongrel":
* mongrel (1.1.6) activated by mongrel (>= 0, runtime)
* mongrel (= 1.1, ) required by mongrel_experimental (>= 0, runtime)
All possible versions of origin requirements conflict.
Run bundle install
to install missing gems
[timor@localhost posts]$ bundle install
Fetching source index from http://gemcutter.org/
Resolving dependencies
Installing rake (0.8.7) from system gems
Installing rails (3.0.0.beta) from system gems
Installing actionpack (3.0.0.beta) from system gems
Installing railties (3.0.0.beta) from system gems
Installing activeresource (3.0.0.beta) from system gems
Installing activerecord (3.0.0.beta) from system gems
Installing activemodel (3.0.0.beta) from system gems
Installing activesupport (3.0.0.beta) from system gems
Installing actionmailer (3.0.0.beta) from system gems
Installing builder (2.1.2) from system gems
Installing rack (1.1.0) from system gems
Installing mongrel_experimental (1.1) from .gem files at /home/timor/.bundle/ruby/1.9.1/cache with native extensions /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/local/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile
make
gcc -I. -I/usr/local/include/ruby-1.9.1/i686-lin..............
.........................
rch’ differ in signedness
uri_classifier.c:186: error: ‘struct RString’ has no member named ‘len’
make: *** [uri_classifier.o] Error 1
Gem files will remain installed in /home/timor/.bundle/ruby/1.9.1/gems/mongrel_experimental-1.1 for inspection.
Results logged to /home/timor/.bundle/ruby/1.9.1/gems/mongrel_experimental-1.1/ext/uri_classifier/gem_make.out
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:
.....................
mongrel_experimental 安装失败
然后我单独安装mongrel_experimental gem
[timor@localhost posts]$ sudo gem install mongrel_experimental
Building native extensions. This could take a while...
ERROR: Error installing mongrel_experimental:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for main() in -lc... yes
creating Makefile
make...................
还是不行。
我用的是CentOS 5.4 , 然后在vps (debian)上 都是同样的错误 .
有没有人成功运行了rails3+mongrel ?