Since the migration to stack heroku-20, wkhtmltopdf doesn't work anymore.
The PDF generation raise this error :
Command Error: /app/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6/bin/wkhtmltopdf:48:in `<main>': Invalid platform, must be running on Ubuntu 16.04/18.04/20.04 CentOS 6/7/8, Debian 9/10, or intel-based Cocoa macOS (missing binary: /app/vendor/bundle/ruby/2.7.0/gems/wkhtmltopdf-binary-0.12.6/bin/wkhtmltopdf_ubuntu_20.04_amd64). (RuntimeError)
I have the same issue with the version wkhtmltopdf-binary-0.12.5 and wkhtmltopdf-binary-0.12.6
Ok problem sovled with the last version of the gem wkhtmltopdf
gem 'wkhtmltopdf-binary', '~> 0.12.6.5'
Related
I'm trying to follow this guide on setting up a GitHub page website. I installed Homebrew, chruby, and Jekyll following this jekyllrb.com tutorial.
When I run ruby -v I get ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin18]. When I run chruby -V I get chruby: 0.3.9. After installing Jekyll with gem install jekyll I get Successfully installed jekyll-4.3.1 Parsing documentation for jekyll-4.3.1 Done installing documentation for Jekyll after 0 seconds 1 gem installed.
But when I run jekyll -v (or any Jekyll command) I get a very long message with the following error:
<internal:/Users/my_username/.rubies/ruby-3.1.2/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require': dlopen(/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown)
/Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle: cannot load 'protobuf_c.bundle' (load command 0x80000034 is unknown) - /Users/my_username/.gem/ruby/3.1.2/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/3.1/protobuf_c.bundle
I spent hours looking at what this error means and found very specific (to some version of Ruby or other libraries) questions like Ruby 2.7.2 google/protobuf_c problem (M1), Ruby: Gem version 3.11.2 doesn't load on Ruby 2.7, and many others.
It's the first time I even hear about Ruby or Jekyll or anything else here and I can't figure out how to properly install these to just make a website on GitHub. I also tried to install Ruby using rvm instead of chruby but that gave the same error. I also tried to install different versions of Ruby, like 3.1.3 and 3.2.0.
When gems have native extensions that need to be compiled it's possible for the gem author to build the extensions in advance and include them in the package so that the gem can install faster than if it were being compiled from scratch. Unfortunately Google has broken this implementation repeatedly.
This has been a problem for about two years with google-protobuf. Google has periodically fixed it and broken it again. They also periodically claim to understand the problem without understanding it and claim to have fixed it without fixing it. And their GitHub issues frequently pass the buck when they're the only ones that can fix it.
Anytime you're dealing with google-protobuf on macOS it's best to ensure that you are compiling it from scratch. This can be done with the --platform argument:
gem install --platform ruby google-protobuf
The platform ruby means don't use any pre-compiled binaries and force compilation from source.
The platform x86_64-darwin means use the pre-compiled binaries for macOS with Intel processors. That's the version that the gem installer identified for your system and used automatically but the error no suitable image found is a macOS error that means this library was not compiled in a way that I can understand.
I am trying to install Beef in a WIndows 10 - 64 bit PC.
I followed the instructions provided in the following link:
https://github.com/beefproject/beef/blob/master/INSTALL.txt
But I keep getting this error:
An error occurred while installing therubyracer (0.11.4), and Bundler
cannot continue. Make sure that gem install therubyracer -v '0.11.3'
succeeds before bundling.
I drilled down a bit & found that the installed version of therubyracer is 0.11.0beta1 x86-mingw32 whereas the installer is searching for version 0.11.3
In the link provided above, the following lines are mentioned in line 38:
Finally, edit beef's gem lock file by replacing the required ruby racer version with the version downloaded from the link above.
But when I do that I get this error:
Your lockfile is unreadable. Run rm Gemfile.lock and then bundle
install to generate a new lockfile.
Can anyone please help me out with this?
Doing what the error message suggests should do the trick. Just remove existing Gemfile.lock in beef project and then run bundle install command once again.
The Gemfile has the the following check:
# Windows support
if RUBY_PLATFORM.downcase.include?('mswin') || RUBY_PLATFORM.downcase.include?('mingw')
# make sure you install this gem following https://github.com/eakmotion/therubyracer_for_windows
gem 'therubyracer', '~> 0.11.0beta1'
elsif !RUBY_PLATFORM.downcase.include?('darwin')
gem 'therubyracer', '0.11.3'
end
So, it will generate a new Gemfile.lock file specific to Windows. The one in the repo is for Ubuntu/Debian.
Even after trying out the solution given by Uzbekjon, I wasn't able to get past the error. Beef requires a javascript runtime for the login page to properly show up. As suggested in the post given here, I got a workaround by installing Node.js
I need a little help. How do I resolve this problem?
When I call cucumber I get the following error:
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansic
on/) to get coloured output on Windows
WARNING: cannot load such file -- 2.2/gherkin_lexer_en
Couldn't load 2.2/gherkin_lexer_en
The $LOAD_PATH was:
lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/cucumber-1.3.19/bin/../lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/builder-3.2.2/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/diff-lcs-1.2.5/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/multi_json-1.11.0/lib
C:/Ruby22/lib/ruby/gems/2.2.0/gems/gherkin-2.12.2-x86-mingw32/lib
[...]
System:
Windows 8.1 x64
Ruby 2.2.1 installer
I got answer:
https://github.com/cucumber/cucumber/issues/830#issuecomment-90837546
I'm afraid Cucumber on Windows/Ruby requires ruby 2.0.0 (x86). The
reason is that the gherkin gem doesn't yet ship with compiled binaries
for more recent versions or Ruby, and not for x64.
We're working on a Gherkin3 which will address this issue. See this
post for background. I cannot give you an ETA, but it's at least a few
months away.
I download Ruby 2.0 x86 from http://rubyinstaller.org/downloads/
Install exe
Command in cmd: gem install calabash-android
ERROR: Error installing calabash-android:
The 'json' native gem requires installed build tools.
Download from http://rubyinstaller.org/downloads/ DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
Extract DevKit to path C:\Ruby200\DevKit
Run cd C:\Ruby200\DevKit
Run ruby dk.rb init
Run ruby dk.rb review
Run ruby dk.rb install
And again use command gem install calabash-android
I have simply solved by removing Gherkin and reinstalling it by bundle install
gem uninstall gherkin
>> select all
bundle install
This problem looks like this issue. Maybe you can resolve by following comments in it. (y)
sanjaykumar5115 commented,
my probelm have been solved after uninstalling gherkin and installing gherkin-2.12.1-x86-mingw32
I'm trying to install the curb gem on windows 7 with libcurl but it returns errors. This is for the eventual purpose of running a ruby app on a vm with vagrant, explained here github catarse install. but it returns an error saying:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe: invalid option -V (-h will show valid
options) (RuntimeError)
these are the versions I have used:
C:\>ruby -v
ruby 1.9.3p392 (2013-02-22) [i386-mingw32]
C:\>gem -v
2.0.3
C:\>vagrant -v
Vagrant version 1.2.2
So I've tried using http://beginrescue.blogspot.com.au/2010/07/installing-curb-with-ruby-191-in.html but there was an error and the make_gem.out file has a lot of these (as an example, I didnt think it necessary to post the whole file):
top:
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-curl-lib=C:\curl-7.30.0-devel-mingw32\bin --with-curl-include=C:\curl-7.30.0-devel-mingw32\include
checking for curl-config... no
checking for main() in -lcurl... yes
checking for curl/curl.h... yes
bottom:
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:454: undefined reference to `_imp__curl_free'
curb_postfield.o: In function `append_to_form':
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:76: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:115: undefined reference to `_imp__curl_formadd'
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems\curb-0.8.4\ext/curb_postfield.c:120: undefined reference to `_imp__curl_formadd'
collect2: ld returned 1 exit status
make: *** [curb_core.so] Error 1
I was getting the same lot of linker errors trying to install curb against the latest (at the time of this post) libcurl 7.32.0. Unfortunately, older versions that used to work for me before (e.g. 7.19.4) no longer include x86-mingw packages with the library and headers.
Here you can find a list of packages including libcurl 7.24.0 that can help you build the extensions. The first post also explains how to extract them and set up the environment. I was then able to install curb 0.8.5 with gem install curb -- --with-opt-dir=c:/path/to/libcurl.
I finally got curb to install by using the source for curl, curl-7.36.0.zip, after having to compile the DevKit, DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe with Ruby200 on windows 7 32bit. curl-7.36.0-win32-fix1.msi with curl-7.36.0-win32-fix1.zip didn't work, nor the older curl-7.34.0-devel-mingw32.zip.
It has been a harrowing experience, googling the problems to have answers given by individuals that don't connect to closed issues, etc.
My stack: Windows 7, git bash 1.8.4.msysgit, ruby 1.9.3p484, rubygems 1.8.28
I got it to work doing the following (mostly mentioned at http://beginrescue.blogspot.com.au/2010/07/installing-curb-with-ruby-191-in.html)
Install DevKit
Download and extract curl-7.34.0-devel-mingw32.zip to C: drive, let's called this location CURL7_HOME.
Add curl bin to the top of my PATH (something I missed the first time)
Install curb: gem install curb -- --with-curl-lib=$CURL7_HOME/bin --with-curl-include=$CURL7_HOME/include
Note: --with-curl-lib=$CURL7_HOME/bin is not a typo. Setting it to bin directory makes it work. I've tried --with-curl-dir=$CURL7_HOME and --with-curl-lib=$CURL7_HOME/lib and those don't work.
I am trying to install wxruby. I've tried gem install wxruby, gem install wxruby-19-2.0.0 downloading the wxruby-2.0.1-universal-darwin-9.gem. I tried the arch -i386 ruby change and got an error on arch of unsupported architecture (on Snow Leopard and Lion).
I've tried it on Mac OS X Lion and Snow Leopard. Under ruby 1.8.7 and 1.9.2. And also tried on Linux (RED-HAT). All gave the same error. When I tried to compile it I got a swig version error which I fixed and then ton's of errors in the code of not finding size_t and other items. I tried a new install of wxwidgets (on Snow Leopard) and that did not help.
It always installs fine but when I run some test code I get:
/Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': dlopen(/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle, 9): no suitable image found. Did find: (LoadError)
/Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle: no matching architecture in universal wrapper - /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wxruby2.bundle
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from /Users/jwright/.rvm/gems/ruby-1.9.2-p290/gems/wxruby-2.0.1-universal-darwin-9/lib/wx.rb:12:in <top (required)>'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:inrequire'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in rescue in require'
from /Users/jwright/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:inrequire'
from ./test_wxruby.rb:3:in `'
It does the same thing when I use irb
require 'rubygems'
require 'wx'
Please help. I really want to use this. My other cross-platform option is JRuby.
It's a known issue. Starting with Snow Laopard, OSX ships with 64-bit ruby set as default. And installed gem is 32-bit. In order to fix this, add following shebang to your ruby script (it will force script to be executed under 32-bit ruby):
#!/usr/bin/env arch -i386 ruby
require 'rubygems'
# This will work thanks to arch -i386
require 'wx'