未加星标

Brew XZ and Nokogiri and Tmux - An Unmitigated Disaster

字体大小 | |
[系统(linux) 所属分类 系统(linux) | 发布者 店小二04 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

It has been one really, really bad day this past 24 hours. While my AWS stability problems have gone away entirely, I had to get a new Rails code base up and running locally today, one done by another developer here. This required Gem install and since it was Rails, that meant a Nokogiri install. And I love what Nokogiri does but I hate , loathe , despise the installation process. In every single repo I work on there is a top level docs directory and then a file called gems.txt which lists what I internally refer to as the incantations . These are those crap ass command lines that are so long you just can’t remember them. Here’s the list of the tricks that I use to install Nokogiri when it inevitably fails:

gem install nokogumbo -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries --with-pkg-config=/usr/local/bin/pkg-config gem install nokogiri -- --with-xml2-include=/usr/local/opt/libxml2/lib --use-system-libraries --with-pkg-config=/usr/local/bin/pkg-config

And not one of those worked. The one that usually works without fail is:

gem install nokogiri -- --with-xml2-include=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/libxml2 --use-system-libraries

but not today. I knew this was going to be a bad day. I told the other guy here “your code, doesn’t install; give me solution”. He found this nugget of disturbing truth . Apparently there is an incompatibility between Nokogiri and xz. His suggestion was uninstall xz and I did that. And Nokogiri was then fine but I had to also reinstall ruby. And that did work until about an hour ago when I had a late night desire to write about Docker (hey - it is my Friday night; I can spend it however I please) and I started getting this little gem of an error:

jekyll post "Learning From a Docker Captain - Nick Janetakis - Making AWS Monitor Run Under Docker" Your bundle is locked to i18n (0.7.0), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of i18n (0.7.0) has removed it. You'll need to update your bundle to a different version of i18n (0.7.0) that hasn't been removed in order to install. Run `bundle install` to install missing gems.

And this led to the inevitable cavalcade of swearing, muttering and normal gyrations when something absolutely essential to you is broken and you have no idea why. Brew wouldn’t work, Gem wouldn’t work, Bundler wouldn’t work, etc. Here was the problem:

I run jekyll under a Tmuxinator/Tmux shell which runs the server in one window, runs the command line in another and a 3rd tab to remind me to migrate my old Radio Userland blog into Jekyll. Remember that ruby re-install? Well Tmuxinator knows what the Ruby is and that ruby had gone away. So everything was trying to reference an executable that was no longer there and apparently the normal error for that is something about i18n. Sheesh.

And I do get it, this was an exceptional set of circumstances but it still did cost me about half a man day on a day when I can ill afford it. And it made me surly, nasty and unresponsive to my family and while that’s on me, that’s definitely not cool.

What to Do?

This is a hard one. I rely on brew as does, well, every developer I know on OSX. And since xz is a required part of brew (as well as the miraculous ag), getting rid of it is likely bad. What I should have done is:

brew unlink xz BEFORE my nokogiri install nokogiri install (with one of my incantations) brew link xz

But, honestly, it is 2016 after all, doesn’t that feel, well, dated ? I don’t know about anybody else out there but it feels like this is my Murtagh Moment, the I’m too old for this shite point of a technology transition. Nick has been pushing me for a while to make the Docker transition for development and I think it is time. Dv and I tried this back in 2014 and failed miserably at it but Docker is loads better now. And since I can’t run my monitoring code on the machine that is permanently hooked up to the internet (again a Nokogiri failure), well, I guess I’ll make that work first and then figure this all out. Sigh. What a craptastic day here in the “what’s broken today world”.

And I am sure that this will get fixed at some point but the question:

when will it be fixed will I then even update to that version

If I move to Docker for my development then I skip the whole bundle install crap fest and everything will run under linux. I’m finding it harder and hard to object to that.

A Great Docker Resource

Obligatory disclaimer Nick Janetakis is now a friend of mine. But he is a bona fide Docker expert, a Docker Captain. He also has a good course on Docker for Devops hosted on Udemy. he has a few others too but this one I’ve taken parts of and I know is excellent. Recommended.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: DockerMacOSLinuxRuby
分页:12
转载请注明
本文标题:Brew XZ and Nokogiri and Tmux - An Unmitigated Disaster
本站链接:http://www.codesec.net/view/483184.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(38)