Documentation - Prerequisites (Fix)
In the documentation is said:
sudo apt install software-properties-common
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.3 ruby2.3-dev build-essential
Fix the last line to:
sudo apt install ruby2.3 ruby2.3-dev build-essential zlib1g-dev liblzma-dev libmysqlclient-dev
On the pre requisites page libmysqlclient-dev is mentioned under MySQL already as it is more relevant there.
Where have zlib1g-dev and liblzma-dev come from?
Because nokogiri gem is not installing without them (zlib1g-dev and liblzma-dev).
Sorry about libmysqlclient-dev, I haven't looked at this section because I have a separate DB server. But I think that this dependency must be in the base section.
Can you send a copy of the error message you see when installing Postal? People have had issues with this gem in the past.
I can't show you the error itself on installation (because it was yesterday and it disappeared), but I can show you a log file after that error.
cat /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.7.2/mkmf.log
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/ruby2.3-dDq47g/ruby2.3-2.3.6/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm -lc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"gcc -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Werror -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main() {return 0;}
/* end */
have_library: checking for gzdopen() in -lz... -------------------- no
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/ruby2.3-dDq47g/ruby2.3-2.3.6/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.3 -lz -lpthread -lgmp -ldl -lcrypt -lm -lc "
conftest.c:3:18: fatal error: zlib.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <zlib.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: int t(void) { void ((*volatile p)()); p = (void ((*)()))gzdopen; return !p; }
/* end */
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -g -DXP_UNIX -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -L/build/ruby2.3-dDq47g/ruby2.3-2.3.6/debian/lib -fstack-protector -rdynamic -Wl,-export-dynamic -lruby-2.3 -lz -lpthread -lgmp -ldl -lcrypt -lm -lc "
conftest.c:3:18: fatal error: zlib.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <zlib.h>
4:
5: /*top*/
6: extern int t(void);
7: int main(int argc, char **argv)
8: {
9: if (argc > 1000000) {
10: printf("%p", &t);
11: }
12:
13: return 0;
14: }
15: extern void gzdopen();
16: int t(void) { gzdopen(); return 0; }
/* end */
--------------------
Okey, from this log I see that we only need zlib1g-dev. But when I google yesterday there was suggestion on stackoverflow or github to install them both.
Interesting, are you definitely on Ubuntu 16.04?
Yep. But I have own cloud on XEN and when I install Ubuntu I remove all checkboxes from suggested packages on installation process to make OS maximally clean.
Ah yes it would seem that the package isn't always available by default, not even in some readily available cloud providers (https://github.com/ModernMT/MMT/issues/231).
Someone from atech will need to update the wiki to add in zlib1g-dev and move libmysqlclient-dev but we don't seem to have liblzma-dev installed and have no problems.