Heroku + MiniMagick + ImageMagick error loading libraries - heroku

I am on Heroku using a RoR app.
I am using carrierwave and with mini_magick (imagemagick).
Everything works fine on my local server.
On heroku I get the following error:
Icon Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: `identify /tmp/mini_magick20181115-4-12nnpxw.png` failed with error: identify: error while loading shared libraries: libdjvulibre.so.21: cannot open shared object file: No such file or directory
It seems libdjvulibre.so.21 is not present. I have added the buildpack for imagemagick: https://github.com/ello/heroku-buildpack-imagemagick
Any suggestions?

Okay, so after contacting support ("we don't deal with third party build packs") and lots of help from some friends, the solution is frustratingly simple (on heroku-18 stacks):
Delete the build pack.
Unless you need a different version than what ships (https://devcenter.heroku.com/articles/stack-packages), which is 8:6.9.7.4​+dfsg-16​ubuntu6.4, then just remove the pack. This worked for me on my staging environment.

Related

How to install graphicsmagick with freetype support in heroku?

I'm trying to get GraphicsMagick to work on a heroku-20 stack, but am running into issues.
All the buildpacks I could find either were not working on the 20 stack, or if they did, they didn't include freetype support.
My "best try" was using
https://github.com/bogini/heroku-buildpack-graphicsmagick
https://github.com/heroku/heroku-buildpack-apt
to get at least the gm command to work, however, when trying to apply some text on an image, i run into this error:
Error: Command failed: gm convert: FreeType library is not available (/usr/share/fonts/type1/gsfonts/n019003l.pfb) [No such file or directory].
Did anyone manage to get this working, or point me to how could I approach this problem?
I faced the same problem. And finally, I solved the problem and now the gm library is working perfectly.
First, you should make your Heroku stack be: Heroku-18
by run this in terminal
$ heroku stack:set heroku-18
Second, you should add these two Buildpack in Heroku:
https://github.com/DuckyTeam/heroku-buildpack-imagemagick
https://github.com/xerpa/heroku-buildpack-graphicsmagick.git
like this:
Note: The order is important
The final Heroku project settings must be like this:

How to fix "s3_website" issue while pushing Jekyll site on CloudFront through gitlab CI/CD?

I have created Pipeline in GitLabs and I am using docker as gitlab-runner. I want to push Jekyll website on s3 website. And to do so, I am using s3_website gem. I have 4 stages defined in my pipeline. Where I am building Jekyll, creating Artifacts using Gulp, executing test on my jekyll site and then deploying.
All steps are working fine but while doing deployment, I'm getting following error. And i could not figure it how to get this solve.
[fail] Could not load the site: Failed to parse ERB in /builds/myproject/s3_website.yml:
(SyntaxError) /usr/local/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_warn.rb:15: syntax error, unexpected tLABEL
module_function define_method(:warn) {|*messages, uplevel: nil|
It is working perfectly fine on my local machine when I'm not on Docker. But when I try to do the same thing using docker. It is giving me above error.
I tried it with ruby 2.3, 2.4, 2.5, 2.6 on my docker machine. However no luck.
bundle exec s3_website push
I am expecting this to deploy the site on S3 bucket and corresponding cloudfront.
Any clue would be appreciated.
We ran into this same error on CircleCI. If I understand correctly, the s3_website gem wraps a Java .jar that's using JRuby 1.7, and something must have changed in one of the Docker images or Ruby gems that causes it to start inheriting the system's Ruby 2+ path. As a result, its JRuby 1.7 tries to load Ruby gems that only work in Ruby 2.0 and above, so it runs into errors.
As a workaround, instead of letting the s3_website gem invoke the .jar file itself, I tell the s3_website gem to only download the .jar file, then I manually invoke it:
bundle exec s3_website install
java -cp $(bundle show s3_website)/*.jar s3.website.Push
I reported this on the s3_website project's GitHub page.
Same error message but different solution.
The root of my problem was that the S3_ACCESS_KEY_ID wasn't set properly. I source'd my .env file
source .env
And that loaded the access key variable and the deploy worked.

error while loading shared libraries: libicui18n.so.42

I am using imagekit gem for one of my projects to create image from html. Imagekit uses wkhtmltoimage to generate image from html.
I have installed wkhtmltoimage using gem install wkhtmltoimage-binary. But when I try running the example /usr/bin/wkhtmltoimage --help I am getting following error:
/usr/bin/wkhtmltoimage: error while loading shared libraries: libicui18n.so.42: cannot open shared object file: No such file or directory.
I am running my Ruby on Rails 4 project on Centos 6.6 server.
Please suggest.

Could not find 'flat-ui.css' in any of your source paths while generating Flat UI Pro in rails app

I am integrating licensed version of flat-ui-pro with my Rails app.
For this, I am using 'designmodo-flatuipro-rails' gem
My environments are:-
OS - Windows7 32-bit
Ruby - 1.9.3p327
Rails - 4.0.0
twitter-bootstrap-rails - 2.2.8
jquery-ui-rails - 4.0.5
designmodo-flatuipro-rails - 1.1.4.2
I have generated "bootstrap_and_overrides.css" file by bootstrap generator at location "app/assets/stylesheets/". I am not using ".less" files for bootstrap.
I am also not getting Cannot detect twitter-bootstrap-rails install error
and Invalid Flat UI Pro directory error while running the flatUI generating command. It means I am inside the right FlatUI directory.
When I run the flat-ui-pro generate command rails g flatuipro:install ./FlatUI/HTML/UI/Flat-UI-Pro-1.1.4, It is throwing a error
Could not find "./FlatUI/HTML/UI/Flat-UI-Pro-1.1.4/css/flat-ui.css" in any of yo
ur source paths. Your current source paths are:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/designmodo-flatuipro-rails-1.1.4.2/lib/gener
ators/flatuipro/install/templates
I am getting the same error while passing the FlatUI directory containing PSD and HTML both.
I am not understanding why generator can not recognizing flat-ui.css in the right directory.
I used differ version of gem "designmodo-flatuipro-rails", "~> 1.2.2.0.branch" with the other version of FlatUI-Pro directory (1.2.2) but also getting the same error.
This is tree of FlatUiPro directory:-
Please reply with good suggestions.
Thanks.
Try changing your relative-path to the Flat-UI Pro Directory to "absolute" in the rails "generate" command, seems to work only for absolute paths!
After getting stuck very much, I found the solution.
I was hitting command in cmd-prompt:-
rails g flatuipro:install ./FlatUI/HTML/UI/Flat-UI-Pro-1.1.4
It will work with Mac/Ubuntu OS as creator of flatui-gem explained in the issue created on github <<Link of Github Issue>>
In Windows, it is mandatory to put the flatui directory out of the project folder.
For example:-
My FlatUIPro directory saved in "D:" drive, so my command will be
rails g flatuipro:install D:/FlatUI
or
rails g flatuipro:install D:/FlatUI/HTML/UI/Flat-UI-Pro-1.1.4
Please check your Flat UI Pro directory... you really are missing demo.css for some reason. Try re-downloading the Flat UI Pro assets from designmodo

Abiword on heroku

I am trying to install abiword on heroku, by wrapping it in a ruby gem.
I statically compiled a 64 bit binary for abiword using the following commands
$ ./configure --enable-shared=no --enable-static=yes
$ make
I then take the abiword binary from the above compile and place it in my ruby gem directory structure and build it.
I subsequently pushed this gem to github.
Now I try to install it on heroku.
The install works fine.
When I try to run the line of code that calls abiword raises the following error
/app/.bundle/gems/ruby/1.9.1/bundler/gems/abiword-8f24c3c3c8ef/bin/abiword: error while loading shared libraries: libfribidi.so.0: cannot open shared object file: No such file or directory
Now why is it trying to find a shared library. Should it not have a static copy of this library to work with.
Any ideas what I may be doing wrong.
Any help appreciated.
Couldn;t make it work. So I moved all my code to AWS EC2 directly ( bypassing heroku )

Resources