2020-09-17

gem installでnokogiriとrmagickが失敗する場合

なぜ失敗するかというと、nokogiriとrmagickはシステムに特定のソフトウェアやライブラリが入っていることに依存しているからだ。依存しているソフトウェアやライブラリをPATHの通った場所に用意してやらなければビルドができない。

nokogiriで問題になるのは主にlibxml2だ。nokogiriは独自のパッチをあてたlibxml2をビルドして使う。libxml2のビルドに必要になるソフトウェアとライブラリがある。

具体的な方法は公式ドキュメントに情報がある。

Installing Nokogiri - Nokogiri

特に入っていない可能性が高いのはzlibとliblzmaだ。Debian系ならば以下のようにパッケージをインストールする必要がある。


apt install build-essential patch ruby-dev zlib1g-dev liblzma-dev

rmagicはImageMagickのRuby bindingだが、システムにImageMagickがインストールされていなければならない。またインスールされているヘッダーファイルやオブジェクトファイルを発見するためにpkg-configも必要だ。

GitHub - rmagick/rmagick: Ruby bindings for ImageMagick

Debian系では以下のように依存パッケージをインストールする


apt install build-essential pkg-config libmagicwand-dev

47 comments:

Anonymous said...

twitterの方で依存地獄とお嘆きのようですが、コンパイルのためにincludeファイルを仕入れる必要があるとか精々その程度で、本物の地獄ではないのかと。Dependency Hell は、ひとつのライブラリのバージョンなどの不整合が依存関係にあるライブラリに次々と波及していくような状態を表した俗語のようです。まあ、これをソースからのビルドで解決しようなどと(お馬鹿なことを)すると configure を通した瞬間「あれがない」とか「これは古い」とか言い出して、それらすべてを修正しなければならなくなります(=Dependency Hellでの Death March)。特に悲惨なのが、これをクロスでやらなければならない場合で、クロス・コンパイルをあまり意識しないで作られた configure も多く(クロスの実行コードをホストでテスト実行しようとしたり、最後の最後でクロスは拒否するとか言って来たりする)、これらの修正から行わないとならない場合もあります(=本当に地獄)。

Công ty CP dịch thuật miền trung - MIDtrans said...

Dịch thuật Việt là chuyên trang về các giải pháp biên dịch (công chứng và chuyên ngành), cung cấp nhân lực phiên dịch dự án ngắn và trung hạn
Ra đời từ 2016, hoạt động trong lĩnh vực dịch thuật và chuyển đổi ngôn ngữ và để đáp ứng nhu cầu tại thị trường Việt Nam cho các tổ chức phi chính phủ, các tập đoàn đa Quốc Gia,và đặc biệt chuyên dịch thuật các dự án hỗ trợ phát triển cho chính phủ Việt Nam Chúng tôi có kinh nghiệm triển khai hỗ trợ dịch thuật phiên dịch các dự án đa ngành như kinh tế, kỹ thuật, tài chính ngân hàng, quản trị kinh doanh…. với trên 50 ngôn ngữ phổ thông khác nhau

Robin Adam said...

Very informative blog! Thanks for sharing the software installation about If nokogiri and rmagick fail with gem install.
Custom Vape Cartridge Packaging

Custom Boxes World USA said...

Custom Boxes World attractive your clients will beg for your merchandise is made by the multiple Boxes. We all know the tendencies of beliefs and styles which have been introduced. Custom Printed Boxes Wholesale

georgedaltone said...

Your blog is very frinedly.I really like if can you write on black mailer boxes.

Custom Boxes World UK said...

Finding **Essential Oil Boxes** for essential oils such as vehicle diffusers and oil diffusers online with **Custom Boxes World UK** is simple and with just several ticks.
Essential Oil Boxes

Custom Boxes World UK said...

We provide you with a wide range of excellent customization options that are suitable enough to draw your shoppers' attention to your things like scents, drinks, oils, recipes pressed in their simple jars. Custom 30ml Bottle Packaging Boxes

Custom Boxes World UK said...

Custom Double Divider tuck front Boxes are handy to use and can be conveniently stacked. These Tuck Front Boxes help with a variety of abilities due to their adaptable nature. Tuck Front Boxes

Custom Boxes World UK said...

Custom Boxes World UK offers an affordable range of designed Bath Bomb Boxes. That will not only make your packaging of bath bomb appealing. But will also convert your custom bath bombs into a style icon. Everyone manufacturer wishes to get appealing custom bath bomb packaging wholesale.

Custom Boxes World UK said...

Custom Boxes World UK is providing Essential Oil Boxes at wholesale. So, you can get custom boxes for your essential oil bottle with the best option. Moreover, our team create exclusive looking essential oil boxes as per your requirements.

Custom Boxes World UK said...

The point of view of a specific E-Liquid packaging boxesdecides how individuals will prefer the article. There may be some groups that could do without the style, and for them, our liquid and personalized. Custom 60ml Bottle Packaging Boxes will be an interest for the charm that your point of view has.

Custom Boxes World UK said...

If you are looking for the ideal method to Essential Oil Boxes and transport your essential oils, you have come to the perfect place. We can suggest a couple of package fixes, depending on how you usually sell your oils, your satisfaction cycle, and your image maintenance estimates.

Custom Boxes World UK said...

In case you prefer to give scent boxes to your sweetheart in commemoration of Valentine's Day, in this event, we can personalize these Custom 2 Oz Bottle Boxes as indicated in this theme. You can also print your custom 2 oz clinical container boxes with our quirky and enriching highlights for each particular festival. We offer custom 2 oz membership jar boxes and custom 2 oz container packs with full customization options.

Custom Boxes World UK said...

Soap boxes UK offer custom soap boxes of all kind of shapes, style and designs at wholesale rates. So, you can make customize changes and distinguish your brand in the market. Soap Packaging UK

Custom Boxes World UK said...

Bottle items and their packaging prerequisites are the need of time. Regardless of whether these are as Custom Dropper Bottle Boxes or some other packaging and pressing, their viability has been endorsed by medical care trained professionals. That is the reason hemp items and Custom 1 Oz Bottle Boxes have been reported legitimate because of their various helpful wellbeing and restorative impacts; individuals worldwide have begun understanding the key significance of these plants.

Custom Boxes World UK said...

Packaging is perhaps the most professional printing and custom boxing organization in the UK. We serve our vast and satisfying customer base with the help of our appealing bundle boxes. Eye Drop Boxes

Custom Boxes World UK said...

Avail appealing ideas to embellish the outlook of face cosmetics through your unique mirror boxes. Gather your distinct identity by getting high quality packaging boxes made exactly according to your desired demand. Custom Mirror Boxes

Custom Boxes World UK said...

Luxury Custom Lip Balm Boxes has a vital part in boosting your business revenue. These containers are accessible in various shades and patterns. Custom Boxes World UK is a packing company that craft packing containers with the durable stuff. Get Wholesale Lip Balm Packaging Boxes in affordable rates. Lip Balm Boxes

Custom Boxes World UK said...

Custom 60 ml Bottle Packaging Boxes use to engage customers and build your trustworthiness. Box customization sends a reasonable message: "This deal with our item and customers most meticulously, starting from the package," and could lead to the customer's last purchase. Also, note that a case along with your sizes allows you to guarantee the item and advance in the package store network.

Custom Boxes World UK said...

The vape is a cutting edge result of the tobacco business, used for today's cigarettes; the vape business features the number of items used by people worldwide. Vape items incorporate vape juice, e-fluids, and many more things. Vape Vaping Packaging Boxes

Custom Boxes World UK said...

Nuggets also fall in the fast food category and are one of the most consumed food items. With ever increasing consumption and competition Custom Nugget boxes offer you the upper hand, a custom style nugget box will act as an advertiser for your business. Nuggets Boxes

Custom Boxes World UK said...

Custom Boxes offers the best nature of the 10ml bottle boxes. We are in the first place offering discounts on 10ml plastic shower bottles. Now you can free yourself from the cost of the 10 ml bottle box format here. You can get a discount on 10ml dropper bottles. Custom 10 ml Bottle Boxes

Custom Boxes World UK said...

30ml color boxes are the most valuable and valuable package for retailers to advance their products. These are very helpful and powerful in delivering the cannabidiol product to the customers. It makes the package that focuses on keeping the Custom 30ml Bottle Packaging Boxes quality and adequacy of your essential things in perfect condition.

Custom Boxes World UK said...

Finding Essential Oil Boxes for essential oils such as vehicle diffusers and oil diffusers online with **Custom Boxes World UK** is simple and with just several ticks.

Custom Boxes World UK said...

Request soap packaging boxes from Soap Packaging. We offer platform printing Soap Packaging UK with free transportation costs in the UK. Custom boxes are the ideal alternative for minor and mass soap producers. Discount Custom Soap Boxes in the UK suggests custom handcrafted packaging with a logo.

Custom Boxes World UK said...

The Kraftplatforms industry is perhaps the most eminent enterprise worldwide, with the UK driving with probably the most significant market. The Wholesale Soap Packaging is high on each maker that is glad to have a couple of clients; they purchase hand-crafted platforms from packaging organizations that they like.

unitymedianews said...

Unity Media News is a Premier tech news website with a special focus on breaking news about technology from all over the world. All about the latest in tech news and other inventions will discuss here.

Custom Boxes World UK said...

These boxes can be customized entirely, such as their shape and size, unlike standard cardboard that can be customized to be your product's subject matter. When the product of Die-Cut Cardboard Boxes ship by air, shipping container, car, the waste of space wastes. While die-cut boxes fit your product as opposed to a standard box. It reduces the space leftover during shipping. And it also protects against the need for additional packaging.

Custom Boxes World UK said...

We provide high-quality digital and offset printing bulk 30 ml bottle boxes to bring all your artwork and images to life for sailing and protecting. Also guiding the traditional products contained within it. We will make custom 30ml Bottle Packaging Boxes to keep your liquid product safe in the best possible way. We can design eye-catching designs on top of these 30 ml dropper boxes that attract more customers and become the center of their attention.

Custom Boxes World UK said...

Order soap packaging boxes at Wholesale Soap Packaging Boxes UK. Our custom soap boxes packaging can make a boost to your soap items sales with your branding details. We offer soap box printing UK with free shipping cost in the UK. Wholesale Soap Packaging Boxes UK

Custom Boxes World UK said...

These boxes will be perfect for you to pack a variety of products that will give your customer a chance to wow. We provide you with these Truffle Boxes to pack a variety of gifts on your doorstep. As well as providing a beautiful way to pack exclusively sweet gifts. You can get customized all the empty truffle boxes from small to large size using our company. Hire us as a truffle boxes UK Manufacturing Company.

Custom Boxes World UK said...

Custom Boxes World UK offers a range of Custom Hair Dryer Boxes wholesale in different shapes and sizes. We use the finest quality material for hairdryer packaging.

Custom Boxes World UK said...

Hair Extension has an incredible interest in the market these days given its quality to develop the look of hair quickly. This article is a streamlined and protected restructured boundary request to give people the best quality Hair Extension Packaging they need. We plan and remake delicious pictures in correspondence with the nature of hair augmentation.

Custom Boxes World UK said...

Customs four corner boxes are exclusively created for the security of this Four Corner Cake Boxes, cupcake, and distinct bakery materials. These boxes are made in such a manner that it’s integrated support is inserted. And stop from harm.

life in lines said...

Eso Sip of Stamina
Life in lines is a good life ideas for the whole humanity. We are here to serve you with different tips and tricks about technology, home decor, fashion, business, health, entertainment and much more for your batter life style. Our mission is keep you update with latest news and trends in the world.

Custom Boxes World UK said...

In the market many garment manufacturer selling cloth products. We are offering you a brilliant garment box as your own design. We can print custom boxes with logo, product image, and company/product information. Shirt Packaging Boxes UK

Unknown said...

The Move Me Professional Movers and Packers in Dubai. Contact us today for professional movers in Dubai. Make your move stress-free with The Move Me movers and packers in Dubai, UAE.
the move me moving and packing service in dubai

Custom Boxes World UK said...

One of the most important things that you need to be considered when you are going to purchase a significant number of packaging Gift Boxes Wholesale is wholesale prices.

Custom Boxes World UK said...

We never compromise on the quality of the Custom Compact Blush Boxes despite our lowest market rates. Besides, we also provide free design assistance to our clients who need any sort of help or assistance.

Custom Boxes World UK said...

We offer the lowest possible Wholesale Cream Butter Boxes prices in comparison to market rates. Moreover, we have no minimum order. We address our customers’ needs in the best possible manner and their satisfaction is our top priority.

Custom Boxes World UK said...

We offer custom Eye Shadow Boxes in a wide range of materials, treatments, and embellishments to compliment your brand.

Custom Boxes World UK said...

Do you want to protect your Custom 10ml Bottle Boxes from lavishly printed papers? Hit the button order now and have the vast range of themes and templates for your 10ml bottles boxes.

Custom Boxes World UK said...

In the same way, we are the best for you who deliver these Gift Boxes Wholesale UK to your doorstep according to your desired size, shape, and color at a reasonable price without reducing your budget.

Custom Boxes World UK said...

Our engineers precisely make Custom Lip Balm Boxes Wholesale in any sizes you need. Choose appropriate materials to craft containers in your specified dimensions. Custom printed lip balm boxes wholesale are best in meeting your packing requirements.

Custom Boxes World UK said...

While buying Custom Soap Boxes you should consider all the factors that will influence a customer’s purchase. Wholesale soap UK considers all of these factors for you. And engages themselves in creating premium quality wholesale soap packaging.

Custom Boxes World UK said...

Our engineers precisely make Lip Balm Boxes Wholesale in any size you need. Choose appropriate materials to craft containers in your specified dimensions. Custom printed Lip Balm Boxes wholesale are best in meeting your packing requirements.

Custom Boxes World UK said...

our company delivers Reverse Tuck End Boxes UK all over the world and is known as a reliable company, our company uses graphic materials which are known as eco-friendly materials and the whole world and Protects them from various environmental and thermal changes and protects them from moisture during delivery from one country to another.