Rails 7, vips on M1 MacBook Air - ruby-on-rails

I'm unable to use Rails 7.0.3.1 with vips on an M1 MacBook Air due to the error:
rails aborted!
LoadError: Could not open library 'glib-2.0.0': dlopen(glib-2.0.0, 0x0005): tried: 'glib-2.0.0' (no such file), '/usr/local/lib/glib-2.0.0' (no such file), '/usr/lib/glib-2.0.0' (no such file), '/Users/brody/Code/tms.next-tms.com.wip2/glib-2.0.0' (no such file).
Could not open library '/opt/local/lib/libglib-2.0.0.dylib': dlopen(/opt/local/lib/libglib-2.0.0.dylib, 0x0005): tried: '/opt/local/lib/libglib-2.0.0.dylib' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
I'm using ffi 1.15.1 and can see it searching correctly in /opt/local/lib, but the homebrew package builds binaries for x86_64 rather than arm64e even while using the --build-from-source option (brew install vips --build-from-source).
Has anyone got this working?

I ran into the same issue (with libglib-2.0.0) but then I figured that brew poured glib--2.74.5.arm64_monterey.bottle so why does it find 2.0.0? In my case it was (a dated version of) Navicat linking an old glib
~$ ls -l /usr/local/lib/libglib*
0 lrwxr-xr-x 1 chaos staff 73B Dec 11 11:23 /usr/local/lib/libglib-2.0.0.dylib -> /Applications/Navicat Premium.app/Contents/Frameworks/libglib-2.0.0.dylib
This wasn't the only file however, Navicat linked a total of 71 dylib files. I removed all those symlinks and then the error disappeared

Related

MikTex, package miktex-latex could not be installed

I "upgraded" from Windows 10 to Windows 11, and my MikTex developed problems. It still works, but gives this warning:
======================================================================
starting package maintenance...
installation directory: C:\Users\ccc31\AppData\Local\Programs\MiKTeX
package repository: https://mirror2.sandyriver.net/pub/ctan/systems/win32/miktex/tm/packages/
package repository digest: 01f4511dd3ba7934c7348b504d466b34
going to download 1262 bytes
going to install 4 file(s) (1 package(s))
downloading https://mirror2.sandyriver.net/pub/ctan/systems/win32/miktex/tm/packages/miktex-latex.tar.lzma...
0.00 MB, 0.03 Mbit/s
Unfortunately, the package miktex-latex could not be installed.
Please check the log file:
C:\Users\ccc31\AppData\Local\MiKTeX\miktex\log\pdflatex.log
======================================================================
I noticed from my settings file it says the OS is Windows 10. Here is a portion of my settings file:
ReportDate: 2023-01-31 16:00:55
CurrentVersion: 20.7
SetupDate: 2022-12-19 12:42:00
SetupVersion: 20.6.29
Configuration: Regular
GitInfo: d26133b / 2020-07-31 18:20:50
OS: Windows 10 Home, 64-bit, build 22621
SharedSetup: no
LinkTargetDirectory: C:\Program Files\MiKTeX\miktex\bin\x64
PathOkay: yes
LastUpdateCheck: 2023-01-31 15:48:30
LastUpdate: 2023-01-31 15:49:21
LastUpdateDb: 2023-01-31 15:50:42
SystemAdmin: yes
RootPrivileges: no
AdminMode: no
In trying to troubleshoot this problem, I noticed that I had Miktex in \Program Files and also in AppData\Local\Programs. I am a long time user of latexpdf, so it wouldn't surprise me to learn that I had installed it multiple times in multiple locations.
Any hints on how to diagnose the warning, and how to fix it? Thanks.

MacOS RStudio accessing wrong clang after upgrade to Catalina

After an upgrade to MacOS Catalina, I find that I can no longer install packages from source in the RStudio IDE (v1.2.5001, current stable release).
Example:
> install.packages("processx", type = "source")
trying URL 'https://cran.rstudio.com/src/contrib/processx_3.4.1.tar.gz'
Content type 'application/x-gzip' length 123430 bytes (120 KB)
==================================================
downloaded 120 KB
* installing *source* package ‘processx’ ...
** package ‘processx’ successfully unpacked and MD5 sums checked
** libs
/usr/local/clang4/bin/clang -Wall -g -O2 -Wall tools/px.c -o tools/px
make: *** [tools/px] Killed: 9
ERROR: compilation failed for package ‘processx’
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/processx’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/processx’
Warning in install.packages :
installation of package ‘processx’ had non-zero exit status
In the process I get a popup with this message:
“clang-4.0” cannot be opened because the developer cannot be verified.
It seems that RStudio is pointed at clang from XCode 11.1, rather than the clang 8 I got from CRAN https://cran.r-project.org/bin/macosx/tools/.
Straight from R (e.g. sudo -i R in my terminal) a source install works fine, so it seems to be a matter of getting RStudio to look in the right place for the clang binary.
Any ideas?
I changed my ~/.R/Makevars file to point to a newer version of clang (R recommends 8+), e.g. CC=/usr/local/opt/llvm/bin/clang. I commented out the clang4 lines and created a new set pointing to the updated clang. Worked like a charm, now able to install R packages as usual.
Note: I had previously used brew to update llvm, which installed clang9.
Hope that helps!

Tweak make package failed: libfakeroot.dylib: mach-o, but wrong architecture

I was trying to make my first tweak for ios using Theos.
And I just used a default tweak template(nic.pl), didnt change anything, I got this error when I tried to run make package:
dyld: could not load inserted library '/usr/local/Cellar/fakeroot/1.22/lib/libfakeroot.dylib' because no suitable image found. Did find:
/usr/local/Cellar/fakeroot/1.22/lib/libfakeroot.dylib: mach-o, but wrong architecture
/usr/local/Cellar/fakeroot/1.22/lib/libfakeroot-0.dylib: mach-o, but wrong architecture
/usr/local/bin/fakeroot: line 181: 3701 Abort trap: 6 FAKEROOTKEY=$FAKEROOTKEY DYLD_INSERT_LIBRARIES="$LIB" "$#"
make: *** [internal-package] Error 134
More Information:
Env: Darwin MacBook pro 16.7.0 Darwin Kernel Version 16.7.0
IOS sdk: I am using the newest version of SDK(iosdk11) & Xcode(9.0), I also tried different SDK, but no luck, I assume the problem here is fake root did not generate compatible binary.
Fakeroot: I just did brew install fakeroot to install.
libfakeroot info: /usr/local/Cellar/fakeroot/1.22/lib/libfakeroot.dylib: Mach-O 64-bit dynamically linked shared library x86_64.

Building OpenCV with CUDA support Error on transpose.cu

Recently I am trying to build OpenCV with CUDA support, and I met problem while building the module cudaarithm.
OpenCV source: git cloned from : http://github.com/Itseez/opencv.git
OpenCV branch: master branch
OpenCV commit:
`commit 5466e321b8c8f97536002a357e5b7ff49a5d2bf9, on Tue Feb 10 12:17:11 2015 +0000`
CUDA version: CUDA 6.5
Hardware: MacBook Pro (13-inch, Mid 2010)
GPU: NVIDIA GeForce 320M 256 MB
OS Version: OS X Yosemite
Steps I used:
1. cd in OpenCVSource, then mkdir myrelease, and cd myrelease
2. cmake -DPLANTUML_JAR=/usr/local/Cellar/plantuml/8002 -D BUILD_DOCS=1 -DPYTHON2_LIBRARY=/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib -DPYTHON2_INCLUDE_DIR=/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DPYTHON3_LIBRARY=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/libpython3.4m.dylib -DPYTHON3_INCLUDE_DIR=/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/include/python3.4m -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local -Wno-dev -DNVCC_FLAGS_EXTRA="-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++" -DOPENCV_EXTRA_CXX_FLAGS=" -stdlib=libstdc++" -DOPENCV_EXTRA_EXE_LINKER_FLAGS="-stdlib=libstdc++" ..
3. make VERBOSE=1
Expect Result: Building success without error
Actual Result: when building OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu, error happend like below:
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(61): *error: identifier "getInputMat" is undefined*
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(67): *error: identifier "getOutputMat" is undefined*
/Users/Hawk/Documents/study/DIP/OpenCV/OpenCVSource/modules/cudaarithm/src/cuda/transpose.cu(92): *error: identifier "syncOutput" is undefined*
Then what action I take:
check the code and I found these undefined symboles are defined in OpenCVSource/modules/core/include/opencv2/core/private.cuda.hpp
check the code and I confrim that the "transpose.cu" file include "opencv2/core/private.cuda.hpp"
check the building log, and I the confirm the private.cuda.hpp is in the search path of header file
cp "opencv2/core/private.cuda.hpp" as another file "opencv2/core/hawk.hpp", and then edit "transpose.cu" to include this new file, and I found
the "undifined symbole error" disapeared.
Although this is a workable workaround, I would like know whether the original OpenCV source cannot be compiled.
All, I think I found the problem cause.
Before I met such problem, I've already build and install OpenCV using older code from the git repo. So that there already have header files in my /usr/local/include/opencv2, especially there is /usr/local/include/opencv2/core/private.cuda.hpp.
However, it is an older one that doesn't define the symbols reporting undefined in above question. At the same time I found during the building nvcc have -I/usr/local/include in the command line, so that it use wrong private.cuda.hpp. As you know it should use the one in OpenCVSource, not the older installed one.
I think the solution is to gracefully remove the original installed OpenCV from my computer, then build again. I am trying and I will report later.

Can't upload photo, failed to manipulate minimagick

Using Ruby on Rails, I was trying to upload a photo on my localhost. However, it seems like I can't upload and gets an error:
"Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: Command ("identify -ping /var/folders/rc/zy5w8vkd3m341pndp2d546nm0000gn/T/mini_magick20130103-78039-1m8b1lt.png") failed: {:status_code=>nil, :output=>"dyld: Library not loaded: /usr/X11/lib/libfreetype.6.dylib\n Referenced from: /usr/local/bin/identify\n Reason: Incompatible library version: identify requires version 14.0.0 or later, but libfreetype.6.dylib provides version 13.0.0\n"}"
I am using Homebrew. please help me with this :(
Softwares:Mac OS 10.7.2 (Lion), Xcode 4.1, ImageMagick-6.8.0-10
I met a same error and I used below commands to fix this bug:
jbao009-108: sudo find / -name "libfreetype.6.dylib" -print
/Applications/Inkscape.app/Contents/Resources/lib/libfreetype.6.dylib
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/Library/Frameworks/GStreamer.framework/Versions/0.10/lib/libfreetype.6.dylib
/opt/X11/lib/libfreetype.6.dylib
/usr/local/Cellar/freetype/2.4.10/lib/libfreetype.6.dylib
/usr/local/Cellar/freetype/2.4.11/lib/libfreetype.6.dylib
/usr/local/Cellar/freetype/2.5.3_1/lib/libfreetype.6.dylib
/usr/local/lib/libfreetype.6.dylib
jbao009-108: sudo cp /usr/local/Cellar/freetype/2.5.3_1/lib/libfreetype.6.dylib /usr/local/lib/
These 2 commands will find the latest freetype and copy to system lib

Resources