官方编译指导:http://docs.redisdesktop.com/en/latest/install/#build-from-source
官方github:https://github.com/uglide/RedisDesktopManager
Ubuntu下Redis Desktop Manager的安装和使用:http://www.linuxdiyf.com/linux/20960.html
github上有编译好的alpha版本,如果你是64位的版本可以尝试一下。
ubuntu16.04编译Redis desktop manager的脚本为
下载并切换目录
git clone --recursive https://github.com/uglide/RedisDesktopManager.git -b 0.8.0 rdm && cd ./rdm
编译脚本
cd src/
./configure
source /opt/qt56/bin/qt56-env.sh && qmake && make && sudo make install
cd /usr/share/redis-desktop-manager/bin
sudo mv qt.conf qt.backup
问题1:RedisDesktopManager下载不全的问题。
解决方法:由于官方提供的Git clone命令使用了--recursive参数,这个参数会把git子模块也下载下来。但是子模块里有个google的breakpad,由于google被屏蔽,导致下载不下来,由于这个模块没下载下来,后面到模块也会停止下载。建议去掉--recursive这个参数,然后根据子模块文件.gitmodules里面的内容进行补全,补全时注意大小写和文件名,或者在下载到时候指定分支名称这样就不用再改一次。用官方到命令下载下来到可能也会由空目录,注意检查。
附:.gitmodules里的内容
[submodule "3rdparty/qtconsole"]
path = 3rdparty/qtconsole
url = https://github.com/uglide/QtConsole.git
[submodule "3rdparty/crashreporter"]
path = 3rdparty/crashreporter
url = https://github.com/RedisDesktop/CrashReporter.git
[submodule "3rdparty/easyloggingpp"]
path = 3rdparty/easyloggingpp
url = https://github.com/easylogging/easyloggingpp.git
[submodule "3rdparty/qredisclient"]
path = 3rdparty/qredisclient
url = https://github.com/uglide/qredisclient.git
[submodule "3rdparty/gbreakpad"]
path = 3rdparty/gbreakpad
url = https://chromium.googlesource.com/breakpad/breakpad
[submodule "3rdparty/qgamp"]
path = 3rdparty/qgamp
url = https://github.com/uglide/qgamp.git
[submodule "src/resources/qml/3rdparty/php-unserialize-js"]
path = src/resources/qml/3rdparty/php-unserialize-js
url = https://github.com/uglide/php-unserialize-js.git
附:很难下载的breakpad,下载之后注意改文件夹的名称:http://download.csdn.net/detail/gsls200808/9685507
注意:如果你在能连接google的情况下下载了完整的包含3part目录的rdm源码,编译时务必再次连上google,因为这个版本的breakpad依赖的linux_syscall_support.h会在编译时下载,可能依赖的是不是最新版本而是之前的某一个版本。
问题2:Linux-syscall-support头文件无法下载的问题
fatal: unable to access 'https://chromium.googlesource.com/linux-syscall-support/': Failed to connect to chromium.googlesource.com port 443: 连接超时
/home/liyunzhi/rdm/src/..//build/common_functions: 行 13: ./configure: 权限不够
make: *** 没有指明目标并且找不到 makefile。 停止。
In file included from ../3rdparty/gbreakpad/src/client/linux/dump_writer_common/thread_info.h:37:0,
from ../3rdparty/gbreakpad/src/client/linux/minidump_writer/linux_dumper.h:51, from ../3rdparty/gbreakpad/src/client/linux/minidump_writer/minidump_writer.h:41,
from ../3rdparty/gbreakpad/src/client/linux/handler/exception_handler.h:42,
from modules/crashhandler/crashhandler.cpp:11:
../3rdparty/gbreakpad/src/common/memory.h:51:51: fatal error: third_party/lss/linux_syscall_support.h: 没有那个文件或目录
#include "third_party/lss/linux_syscall_support.h"
^
compilation terminated.
Makefile:11493: recipe for target '../bin/linux/release/obj/crashhandler.o' failed
make: *** [../bin/linux/release/obj/crashhandler.o] Error 1
解决方法:去这里下载:http://download.csdn.net/detail/gsls200808/9685972,解压后先在rdm/3rdparty/gbreakpad/src/third_party目录下创建lls目录,然后复制linux_syscall_support.h到lls目录下,笔者走了很多弯路,一开始从MongoDB的源码里拷贝了一个同名文件放进去,结果很多错误没法解决
这个文件到官方下载地址是google,附原下载命令
git clone https://chromium.googlesource.com/linux-syscall-support
问题3:rdm.qrc找不到phpUnserialize.js这个文件
RCC: Error in 'resources/rdm.qrc': Cannot find file 'qml/3rdparty/php-unserialize-js/phpUnserialize.js'
/opt/qt56/bin/rcc -name rdm resources/rdm.qrc -o ../bin/linux/release/obj/qrc_rdm.cpp
RCC: Error in 'resources/rdm.qrc': Cannot find file 'qml/3rdparty/php-unserialize-js/phpUnserialize.js'
Makefile:753: recipe for target '../bin/linux/release/obj/qrc_rdm.cpp' failed
make: *** [../bin/linux/release/obj/qrc_rdm.cpp] Error 1
解决方法:从github上下载这个文件,然后覆盖掉里面的qml/3rdparty/(完整路径:rdm/src/resources/qml/3rdparty/)目录下的PHP-unserialize-js文件夹即可
下载命令如下
git clone https://github.com/uglide/php-unserialize-js.git
问题4:编译时提示缺少libbreakpad_client.a
g++: error: /home/liyunzhi/rdm/3rdparty/gbreakpad/src/client/linux/libbreakpad_client.a: 没有那个文件或目录
Makefile:472: recipe for target '../bin/linux/release/rdm' failed
make: *** [../bin/linux/release/rdm] Error 1
解决方法:linux/libbreakpad_client.a这个文件需要编译才能生成,切换gbreakpad目录编译即可
问题5:从其他地方下载的configure不能执行的问题
相关报错:
./autotools/depcomp: 行 3: $'\r': 未找到命令
可能情况1:缺少权限,执行命令 sudo chmod 777 configure
可能情况2:windows的git安装时按照默认情况安装出现换行符转换问题,需要先从dos格式转成unix格式,命令如下
先安装vim,执行如下命令
vim configure
:set fileformat=unix
:write
:set ff=unix
:write
或者先安装dos2unix执行命令
dos2unix configure
其它可能需要转换到文件是config.guess config.sub depcomp
问题6:无法启动,提示无法找到xcb,version 'Qt_5'
This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".
Reinstalling the application may fix this problem.
已放弃 (核心已转储)
./rdm: /usr/lib/i386-linux-gnu/libQt5QuickWidgets.so.5: version `Qt_5' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/libQt5Qml.so.5: version `Qt_5' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/sse2/libQt5Gui.so.5: version `Qt_5' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/libQt5Network.so.5: version `Qt_5' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5: version `Qt_5.6' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/sse2/libQt5Core.so.5: version `Qt_5' not found (required by ./rdm)
./rdm: /usr/lib/i386-linux-gnu/libQt5Widgets.so.5: version `Qt_5' not found (required by ./rdm)
解决方法:
先看是否忘记执行qt.conf改名的命令
cd /usr/share/redis-desktop-manager/bin
sudo mv qt.conf qt.backup
如果执行改名后还出现这个问题再看下面的
这个qt环境变量的问题,添加环境变量PATH,QT_QPA_PLATFORM_PLUGIN_PATH,LD_LIBRARY_PATH
sudo gedit ~/.bashrc
在最后添加
export PATH=/opt/qt56/bin:$PATH
export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt56/plugins
export LD_LIBRARY_PATH=/opt/qt56/lib
最后用source命令应用
source ~/.bashrc
问题7:qtbase下载很慢
这个ppa源在英国,没有工具的话就耐心等两个小时或者出去玩一会或者干别的事情
下面是linux-syscall-support头文件不正确的报错,算低级错误了,忽略这一段吧
src/client/linux/crash_generation/crash_generation_client.cc:56:25: error: aggregate ‘google_breakpad::{anonymous}::CrashGenerationClientImpl::RequestDump(const void*, size_t)::kernel_iovec iov’ has incomplete type and cannot be defined
struct kernel_iovec iov;
^
src/client/linux/crash_generation/crash_generation_client.cc:60:26: error: variable ‘google_breakpad::{anonymous}::CrashGenerationClientImpl::RequestDump(const void*, size_t)::kernel_msghdr msg’ has initializer but incomplete type
struct kernel_msghdr msg = { 0 };
^
In file included from src/client/linux/crash_generation/crash_generation_client.cc:37:0:
src/client/linux/crash_generation/crash_generation_client.cc:74:63: error: ‘sys_sendmsg’ was not declared in this scope
ssize_t ret = HANDLE_EINTR(sys_sendmsg(server_fd_, &msg, 0));
查找发现类似的结构体和系统函数是#include <sys/uio.h>的iovec,<sys/socket.h>的msghdr和sendmsg
将kernel_iovec改为iovec,kernel_msghdr改为msghdr,sys_sendmsg改为sendmsg重新编译
src/client/linux/handler/exception_handler.cc: In member function ‘bool google_breakpad::ExceptionHandler::HandleSignal(int, siginfo_t*, void*)’:
src/client/linux/handler/exception_handler.cc:436:42: error: too many arguments to function ‘int sys_prctl(int, long int)’
sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
在436,535和647行,提示提示太多参数,给出到函数只能传两个,那就去掉3个0呗,sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);改成sys_prctl(PR_SET_DUMPABLE, 1);
./src/client/linux/minidump_writer/directory_reader.h:67:57: error: ‘sys_getdents’ was not declared in this scope
const int n = sys_getdents(fd_, dent, sizeof(buf_));
去掉sys_
./src/client/linux/minidump_writer/directory_reader.h:67:57: error: ‘sys_getdents’ was not declared in this scope
const int n = sys_getdents(fd_, dent, sizeof(buf_));
没有定义
include后,define之前加
#include <linux/unistd.h>
#include <dirent.h>
#include <linux/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define __NR_getdents 141
long getdents(unsigned int fd,
struct linux_dirent __user *dirent,
unsigned int count);
_syscall3(long,getdents,unsigned int, fd,
struct linux_dirent __user *, dirent,
unsigned int, count);
./src/client/linux/minidump_writer/directory_reader.h:83:53: error: parameter 2 of ‘long int getdents(unsigned int, linux_dirent)’ has incomplete type ‘linux_dirent’
const int n = getdents(fd_, dent, sizeof(buf_));
改linux_dirent-->dirent
./src/client/linux/minidump_writer/directory_reader.h:83:53: error: could not convert ‘dent’ from ‘kernel_dirent* const’ to ‘dirent’
const int n = getdents(fd_, dent, sizeof(buf_));
改所有kernel_dirent-->dirent
启动命令
cd /usr/share/redis-desktop-manager/bin
./rdm
附一张截图
附编译过的文件下载(是和源码一起打包的):
ubuntu16.04x64版:http://download.csdn.net/detail/gsls200808/9686039
ubuntu16.04x86版:http://download.csdn.net/detail/gsls200808/9687099