Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need of Luajit, steps to install it #30

Open
carlitux opened this issue Nov 25, 2019 · 9 comments
Open

Need of Luajit, steps to install it #30

carlitux opened this issue Nov 25, 2019 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@carlitux
Copy link

Describe the bug
getting module 'ffi' not found as I do not have installed lua in system.

Expected behavior
Do not have external dependencies

Operating System:
POP OS 19.10

Neovim Version:
NVIM v0.5.0-dev

Colorizer Version:
aa5377f040907c5be86499195529c16cb9f5264bAdditional context

@carlitux carlitux added the bug Something isn't working label Nov 25, 2019
@norcalli
Copy link
Owner

It's not a bug. Luajit is a requirement. Unless Neovim has a trie in the core, that won't change. I use it in too many places. We are considering adding one to neovim for other things, but not for a while. Try building with Luajit available.

@carlitux carlitux changed the title Bug: Bug: Need of Luajit Nov 25, 2019
@carlitux
Copy link
Author

got it, so need to clarify in README file.

It has an external dependency (out side neovim) and steps to install it. I don't have experience with lua.

just installed luajit still getting the error

@carlitux carlitux changed the title Bug: Need of Luajit Need of Luajit, steps to install it Nov 26, 2019
@norcalli
Copy link
Owner

No I meant that neovim has luajit built in usually. For it not to be available on your platform is very rare. I'll try to see if I can make instructions for users who come across this problem.

@daveyarwood
Copy link

daveyarwood commented Jan 16, 2020

I also ran into this on Ubuntu 16.04 with Neovim v0.5.0-dev (0.5.0+ubuntu1+git202001142018-3d1531a-00e710e-8b2f2dc~ubuntu16.04.1)

I get this stacktrace when starting Vim (the first line is the one where I invoke lua require'colorizer'.setup())

Error detected while processing /home/dave/.dotfiles/vim/custom/500-plugins-config.vim:
line  917:
E5108: Error executing lua ...me/dave/.vim/bundle/nvim-colorizer.lua//lua/trie.lua:16: module 'ffi' not found:
        no field package.preload['ffi']
        no file '/home/dave/.config/nvim/lua/ffi.lua'
...

@daveyarwood
Copy link

For it not to be available on your platform is very rare.

From what I've read, I think it's more common than you think :)

I think we just need to wait for Ubuntu/Debian distros to catch up.

@carlitux
Copy link
Author

@daveyarwood we have to wait till maintainer link luajit instead of lua. Now I am using appimage from github

@norcalli
Copy link
Owner

norcalli commented Jan 16, 2020 via email

@daveyarwood
Copy link

That sounds awesome! It would be much appreciated; nvim-colorizer.lua looks really cool and I'd love to try it.

@ruifm
Copy link

ruifm commented Apr 27, 2020

In case anyone is interested, I have found a simple check one can do before setting up colorizer:

lua <<
if jit ~= nil then
    require'colorizer'.setup()
end
.

I had to do something similar with completion-nvim:

augroup completion-nvim
    autocmd!
    autocmd BufEnter * lua if jit ~= nil then require'completion'.on_attach() end
augroup end

since it was giving me a similar error due to the lack of linked luajit support in the neovim unstable ubuntu ppa.

This check was useful to me since I like to use the same config files across different systems (as many of you probably do), while not wanting things to break but at the same time, try to use a feature if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants