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

封装成插件.so的问题 #75

Open
glacierck opened this issue Nov 12, 2020 · 2 comments
Open

封装成插件.so的问题 #75

glacierck opened this issue Nov 12, 2020 · 2 comments

Comments

@glacierck
Copy link

我打算将结巴分词封装成动态库.so文件
执行了以下构建语句:

go build -buildmode=plugin -o zh.so ./main.go

在本地开发环境能正常加载插件,但迁移到服务器后出现问题了。发现可能是字典在服务器环境上不存的问题。主程序是在docker里跑的。
容器启动加载插件时报错内容:

2020-11-12 10:28:54 /usr/local/gocode/src/github.com/yanyiwu/gojieba/deps/cppjieba/DictTrie.hpp:203 FATAL exp: [ifs.is_open()] false. open /usr/local/gocode/src/github.com/yanyiwu/gojieba/dict/jieba.dict.utf8 failed.

插件部分内容:
'''
package main

import (
"github.com/yanyiwu/gojieba"
)

var x = gojieba.NewJieba()
'''
我有尝试将/yanyiwu/gojieba项目整个拉进docker容器里,重启容器还是报这个错误。
不知道有什么解决方案不?

@haima95
Copy link

haima95 commented Apr 14, 2021

你好,请问这个你解决了吗?我也遇到这种问题

@shouldsee
Copy link

shouldsee commented Apr 7, 2022

是不是容器内权限有问题?进到容器里开个shell touch一下指定文件看看能不能访问?

touch /usr/local/gocode/src/github.com/yanyiwu/gojieba/dict/jieba.dict.utf8 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants