Read Swiftiply official website The installation steps to install the gem directly:
$ sudo gem install swiftiply
Automatically during the installation process has installed on a rack and EventMachine, Finally Swiftiply compiler error:
Quote
Building native extensions. This could take a while ...
ERROR: Error installing swiftiply:
ERROR: Failed to build gem native extension.
/ usr/bin/ruby1.8 extconf.rb install swiftiply
checking for main () in-lpthread ... yes
checking for sys / epoll.h ... yes
checking for main () in-lssl ... no
creating Makefile
make
g + +-I.-I. -I/usr/lib/ruby/1.8/i486-linux-I.-DHAVE_SYS_EPOLL_H-D_FILE_OFFSET_BITS = 64-DOS_UNIX-DBUILD_FOR_RUBY-DHAVE_EPOLL-DWITHOUT_SSL-fPIC-fno-strict-aliasing-g-g -O2-fPIC-c rubymain.cpp
g + +-I.-I. -I/usr/lib/ruby/1.8/i486-linux-I.-DHAVE_SYS_EPOLL_H-D_FILE_OFFSET_BITS = 64-DOS_UNIX-DBUILD_FOR_RUBY-DHAVE_EPOLL-DWITHOUT_SSL-fPIC-fno-strict-aliasing-g-g -O2-fPIC-c mapper.cpp
mapper.cpp: In constructor 'Mapper_t:: Mapper_t (const std:: string &)':
mapper.cpp: 53: error: 'strerror' was not declared in this scope
mapper.cpp: 57: error: 'strerror' was not declared in this scope
mapper.cpp: 62: error: 'strerror' was not declared in this scope
make: *** [mapper.o] Error 1
Gem files will remain installed in / usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1.1 for inspection.
Results logged to / usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1.1/ext/fastfilereader/gem_make.out
郁闷scar me ah! ! ! Debugging it.
First of all, look at google search: 12 Posts found this problem also, but do not have the answers. Had no choice but to find their own.
I suspect the first step in my development environment are not well fitted, I used the Ubuntu Server 8.10, check it, on the development package is installed, and other software can be compiled, including the mongrel.
Suspected to be the second step of the problem the compiler, gcc or g + +, found a bit, gcc4.3 if there is a similar problem, there is a patch, This is my gcc4.4.3, did not find.
Had no choice but to watch the procedure carefully, and do not goof off and watch the error message should be the issue of the lack of header files in / usr/lib/ruby/gems/1.8/gems/swiftiply-0.6.1.1/ext/fastfilereader / find mapper. cpp file, open look, as if the lack of header files. Just in the documents seized at the time / usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.6/ext/fastfilereader / there is also this document, compare with diff:
$diff mapper.cpp ../../../eventmachine-0.12.6/ext/fastfilereader/mapper.cpp
Quote
34a35
> # Include "unistd.h"
35a37
> # Include <cstring>
59a62, 64
> # Ifdef OS_WIN32
> MapPoint = (char *) mmap (0, FileSize, PROT_READ, MAP_SHARED, Fd, 0);
> # Else
60a66
> # Endif
84a91, 93
> # Ifdef OS_SOLARIS8
> Munmap ((char *) MapPoint, FileSize);
> # Else
85a95
> # Endif
150a161, 163
> # Ifdef OS_WIN32
> MapPoint = (char *) MapViewOfFile (hMapping, FILE_MAP_WRITE, 0, 0, 0);
> # Else
151a165
> # Endif
Output shows that the two header files missing from the statement:
Quote
# include "unistd.h"
# include <cstring>
Vi modify documents with mapper.cpp, together with the two lines.
Then, run the installation program swiftiply:
$ sudo ruby setup.rb
Quote
Building extension in / home/tian/swiftiply-0.6.1.1/ext/fastfilereader with (: mkmf => true).
checking for main () in-lpthread ... yes
checking for sys / epoll.h ... yes
checking for main () in-lssl ... no
creating Makefile
g + +-I.-I. -I/usr/lib/ruby/1.8/i486-linux -I/home/tian/swiftiply-0.6.1.1/ext/fastfilereader-DHAVE_SYS_EPOLL_H-D_FILE_OFFSET_BITS = 64-DOS_UNIX-DBUILD_FOR_RUBY-DHAVE_EPOLL -- DWITHOUT_SSL-fPIC-fno-strict-aliasing-g-g-O2-fPIC-c rubymain.cpp
g + +-I.-I. -I/usr/lib/ruby/1.8/i486-linux -I/home/tian/swiftiply-0.6.1.1/ext/fastfilereader-DHAVE_SYS_EPOLL_H-D_FILE_OFFSET_BITS = 64-DOS_UNIX-DBUILD_FOR_RUBY-DHAVE_EPOLL -- DWITHOUT_SSL-fPIC-fno-strict-aliasing-g-g-O2-fPIC-c mapper.cpp
g + +-shared-o fastfilereaderext.so rubymain.o mapper.o-L. -L/usr/lib-L.-Wl,-Bsymbolic-functions-rdynamic-Wl,-export-dynamic-lruby1.8-lpthread-lpthread -ldl-lcrypt-lm-lc; strip fastfilereaderext.so
Installing Swiftcore Swiftiply ...
mkdir-p / usr / bin
install-c-m 0755 bin / mongrel_rails / usr / bin / mongrel_rails
install-c-m 0755 bin / swiftiply / usr / bin / swiftiply
install-c-m 0755 bin / swiftiply_mongrel_rails / usr / bin / swiftiply_mongrel_rails
mkdir-p / usr/local/lib/site_ruby/1.8/i486-linux
install-c-m 0755 ext / fastfilereader / fastfilereaderext.so / usr/local/lib/site_ruby/1.8/i486-linux/fastfilereaderext.so
mkdir-p / usr/local/lib/site_ruby/1.8/swiftcore
install-c-m 0644 src / swiftcore / Swiftiply.rb / usr/local/lib/site_ruby/1.8/swiftcore/Swiftiply.rb
mkdir-p / usr/local/lib/site_ruby/1.8/swiftcore/Swiftiply
install-c-m 0644 src / swiftcore / Swiftiply / support_pagecache.rb / usr/local/lib/site_ruby/1.8/swiftcore/Swiftiply/support_pagecache.rb
install-c-m 0644 src / swiftcore / Swiftiply / swiftiply_client.rb / usr/local/lib/site_ruby/1.8/swiftcore/Swiftiply/swiftiply_client.rb
install-c-m 0644 src / swiftcore / evented_mongrel.rb / usr/local/lib/site_ruby/1.8/swiftcore/evented_mongrel.rb
install-c-m 0644 src / swiftcore / swiftiplied_mongrel.rb / usr/local/lib/site_ruby/1.8/swiftcore/swiftiplied_mongrel.rb
install-c-m 0644 src / swiftcore / types.rb / usr/local/lib/site_ruby/1.8/swiftcore/types.rb
shebang: open / usr / bin / mongrel_rails.tmp
rm-f / usr / bin / mongrel_rails.tmp
shebang: open / usr / bin / swiftiply.tmp
mv / usr / bin / swiftiply.tmp / usr / bin / swiftiply
rm-f / usr / bin / swiftiply.tmp
shebang: open / usr / bin / swiftiply_mongrel_rails.tmp
rm-f / usr / bin / swiftiply_mongrel_rails.tmp
Generating ri documentation from src / swiftcore / Swiftiply.rb, src / swiftcore / evented_mongrel.rb, src / swiftcore / Swiftiply / swiftiply_client.rb, src / swiftcore / Swiftiply / support_pagecache.rb, src / swiftcore / swiftiplied_mongrel.rb, src / swiftcore / types.rb
Swiftiply.rb: mmccc .............................. c. ...... c. ..... .....
evented_mongrel.rb: mc .... c. ... cc .... c.
swiftiply_client.rb: c. ......
support_pagecache.rb: mmcc .....
swiftiplied_mongrel.rb: mc .... c. ... cc ... c.
types.rb: mcc ........... c. ............... c. ........ c. ..... ..
Generating RI ...
Files: 6
Classes: 23
Modules: 7
Methods: 133
Elapsed: 3.445s
OK! Compiled through!
Swiftiply back up and running relatively smoothly, the application running, the performance has Nginx + Mongrel really improve, especially when complicated by a large, relatively stable performance.
Summary: In the Linux install process, there are often questions compiler thing, it is necessary to solve the problem, the ultimate way to watch the source code.
Mentioned, however Swiftiply, if not many people use ah, the compiler like this question will certainly be encountered, but not found solution, slightly regret.
Operating Environment:
Quote
Ubuntu Server 8.10
ruby 1.8.7
rails 2.3.2
Swiftiply 0.6.1.1







