Open MichaelC001 opened 7 months ago
Hey, I'm not sure how things work on macOS, does this help you? https://github.com/3rd/image.nvim/issues/18#issuecomment-1826976752
Hey, I'm not sure how things work on macOS, does this help you? #18 (comment)
this I tried. still not working
Neovim is supposed to come with LuaJIT, and it should works in its context, your external Lua version doesn't matter.
Check if nvim --version
says it has LuaJIT, and preferably Neovim itslef is v0.10
I had the same problem, and this did the trick: brew install lua51 luarocks --lua-version=5.1 install magick
I have tried this but it didn't work. Which chip you are using? M or intel? @Gabz-Araujo
I followed @Gabz-Araujo and it worked. But, nvim --clean -c ":luafile minimal-setup.lua"
for minimal-setup.lua
does NOT show the image. I use Apple M1.
@spring-haru you will likely have to follow some instructions in the pinned issue if you're on macos
Hi there. It happens on Ubuntu 22.04. Does it relate to the 'magick' command being replaced by convert in 'imagemagick' package?
no, it's using the magick lua rock, you can check if your setup worked by running :lua require("magick")
in neovim, without loading the plugin
I had the same problem, and this did the trick: brew install lua51 luarocks --lua-version=5.1 install magick
This no longer seems to be an option.
Error: lua@5.1 has been disabled because it is deprecated upstream!
Luckily compiling it from source is quite simple.
Getting a similar error on install:
Error detected while processing VIMINIT:
image.nvim: magick rock not found, please install it and restart your editor
[LSP] Format request failed, no matching language servers.
Here's my package path extension:
-- Package Path Upgrade
----------
-- Rocks installed through luarocks.nvim
package.path = package.path .. ";" .. plugin_path .. "/luarocks.nvim/.rocks/share/lua/5.1/?.lua"
package.path = package.path .. ";" .. plugin_path .. "/luarocks.nvim/.rocks/share/lua/5.1/?/init.lua"
-- Rocks installed through local luarocks
package.path = package.path .. ";" .. fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua"
package.path = package.path .. ";" .. fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua"
-- Literally Pointing to my magick install
package.path = package.path .. ";" .. fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/magick/init.lua"
----------
Plugin just doesn't seem to be able to find magick/init.lua???
Plugin just doesn't seem to be able to find magick/init.lua???
Updated it so it shows the loading error for the rock, it might point you in the right direction.
I tried this on my M2 chip Macbook and it worked, see https://github.com/3rd/image.nvim/issues/9#issuecomment-1637153929
change the magick/wand/lib.lua try_to_load
as, for example:
lib = try_to_load("/opt/homebrew/lib/libMagickWand-7.Q16HDRI.dylib", function()
-- local lname = get_flags():match("-l(MagickWand[^%s]*)")
-- local suffix
-- if ffi.os == "OSX" then
-- suffix = ".dylib"
-- elseif ffi.os == "Windows" then
-- suffix = ".dll"
-- else
-- suffix = ".so"
-- end
-- return lname and "lib" .. lname .. suffix
end)
I also have a similar issue. However, I only get image.nvim: magick not found
when I try to run the demo.
I'm on MacOs, on an M2 Pro chip.
I'm running Neovim: 0.9.5
Here's my image.lua file:
return {
"3rd/image.nvim",
dependencies = { "luarocks.nvim" },
}
and here's my rocks.lua file:
return {
"vhyrro/luarocks.nvim",
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
config = true,
}
If I run magick
from the terminal, it works, so the path is set correctly, I think 🤔
If you want to use luarocks.nvim you have to tell it to install the magick rock. Image.nvim doesn't do it automatically like some other plugins do.
Take a look at the image.nvim readme for an example
If you want to use luarocks.nvim you have to tell it to install the magick rock. Image.nvim doesn't do it automatically like some other plugins do.
Take a look at the image.nvim readme for an example
Sorry, you're right. I somehow forgot to add options.
Here's my updated rocks.lua
file:
return {
"vhyrro/luarocks.nvim",
priority = 1000, -- Very high priority is required, luarocks.nvim should run as the first plugin in your config.
opts = {
rocks = { "magick" },
},
}
The issue is still happening. I did restart the terminal.
Probably need to run :Lazy build luarocks.nvim
to install the rock
Probably need to run
:Lazy build luarocks.nvim
to install the rock
Yeah, I also thought so. Didn't help 🤔 . How can I check if the build command worked? Because when I run it, it pops-up the Lazy panel.
Did you follow the other steps for Mac os from the readme? The installing magic part in particular? There's a note about brew installing something in a place that nvim doesn't check and how to fix it
Did you follow the other steps for Mac os from the readme? The installing magic part in particular? There's a note about brew installing something in a place that nvim doesn't check and how to fix it
Yep. I did that:
export DYLD_LIBRARY_PATH="/opt/homebrew/lib/"
and if I check with echo $DYLD_LIBRARY_PATH
it shows the correct path.
What's your exact error? You should get something more than just image.nvim: magick rock not found
I think. and if you don't, make sure you're up to date with the latest version of image.nvim.
@FunnyGhost solved it like https://github.com/3rd/image.nvim/issues/91#issuecomment-2025287226
@benlubas Yes, solved with @3rd's help on Discord. Sorry for the late reply. Thanks a ton for the help 🙏
@mesa123123 About this: image.nvim: magick rock not found, please install it and restart your editor
I listened to @Gabz-Araujo's suggestion:
luarocks --lua-version=5.1 install magick
The solution I found was the following: modify the excerpt from the file '.luarocks/share/lua/5.1/magick/wand/lib.lua':
lib = try_to_load(
"/opt/homebrew/Cellar/imagemagick/7.1.1-30/lib/libMagickWand-7.Q16HDRI.dylib",
"/opt/homebrew/Cellar/imagemagick@6/6.9.13-7/lib/libMagickWand-6.Q16.dylib",
"/opt/homebrew/bin/imagemagick/7.1.1-25/lib/libMagickWand-7.Q16HDRI.dylib"
)
In my case, in the first line:
"/opt/homebrew/Cellar/imagemagick/7.1.1-30/lib/libMagickWand-7.Q16HDRI.dylib", read 7.1.1-29.
Checking the path I realized it should be 7.1.1-30 It worked
after a while try reinstalling lua/luajit and install pkg-config using brew, mine finally works in MacAir M1
Mac os , lua 5.4
image.nvim: magick rock not found, please install it and restart your editor luarocks install magick: To check if it is available for other Lua versions, use --check-lua-versions.
it seems that magic rock only support lua 5.1
How to solve it? Can I run neovim without magic rock?
thank you. This plugin is amazing ,its a game changer!