GED-VIZ部署解决方案

发布于:2025-03-20 ⋅ 阅读:(21) ⋅ 点赞:(0)

项目
https://github.com/bertelsmannstift/GED-VIZ
最终结果如图:
在这里插入图片描述

依赖要求:
Dependencies
一、Ruby 1.9.3 (MRI) with RubyGems. Also works with Ruby 2.1.(测试ruby2.4兼容性更好)
二、MySQL 5.1 or newer(测试过MYSQL5.7在迁移过程会有兼容性问题,建议MYSQL5.5)
三、PhantomJS for generating static images for slide previews, exporting and older browsers(下载JSON可装可不装,目前测试没有影响,下载JSON(可装可不装,目前测试没有影响 下载地址 https://rpmfind.net/linux/dag/redhat/el5/en/x86_64/dag/RPMS/perl-JSON-2.16-1.el5.rf.noarch.rpm安装 rpm -Uvh perl-*.rpm --nodeps --force)

安装REDHAT6.0系统,具体操作网上很多教程。
安装完操作系统,建议
1先执行防火墙开放权限。
sudo iptables -I INPUT -p tcp --dport 3000 -j ACCEPT
保存规则
service iptables save
确保 iptables 服务开机自启
chkconfig iptables on
在这里插入图片描述
或者直接关闭redhat防火墙,等调试完成再开启,关闭防火墙命令为
chkconfig iptables off

下载项目
https://codeload.github.com/bertelsmannstift/GED-VIZ/zip/refs/heads/master
下载完成 解压后放到linux目录中,我是放在/home下

MYSQL5.5安装

测试过MYSQL5.7在迁移过程会有兼容性问题,建议MYSQL5.5,其他版本未知。
先把旧的 MySQL/MariaDB 清理掉
yum remove mysql mysql-server mysql-libs mariadb-libs -y
rm -rf /var/lib/mysql
下载 MySQL 5.5 RPM 包
cd /home
wget https://downloads.mysql.com/archives/get/p/23/file/MySQL-5.5.62-1.el6.x86_64.rpm-bundle.tar
解压文件
tar -xvf MySQL-5.5.62-1.el6.x86_64.rpm-bundle.tar
先安装 common 库
rpm -ivh MySQL-shared-5.5.62-1.el6.x86_64.rpm
安装 Client
rpm -ivh MySQL-client-5.5.62-1.el6.x86_64.rpm
安装 Server
rpm -ivh MySQL-server-5.5.62-1.el6.x86_64.rpm
安装MySQL-devel
wget https://cdn.mysql.com/archives/mysql-5.5/MySQL-devel-5.5.31-2.el6.x86_64.rpm
rpm -ivh MySQL-devel-5.5.31-2.el6.x86_64.rpm
在这里插入图片描述
进入mysql修改密码
mysql -u root
修改MYSQL root 密码:
复制代码
USE mysql;
UPDATE user SET password=PASSWORD(‘new_password’) WHERE user=‘root’;#我设置的密码是new_password
FLUSH PRIVILEGES;
EXIT;

安装ruby2.4.10
wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.10.tar.gz
安装ruby2.4.10
tar -xzf ruby-2.4.10.tar.gz
cd ruby-2.4.10
./configure --prefix=/usr/local/ruby-2.4
make -j ( n p r o c ) m a k e i n s t a l l e c h o ′ e x p o r t P A T H = / u s r / l o c a l / r u b y − 2.4 / b i n : (nproc) make install echo 'export PATH=/usr/local/ruby-2.4/bin: (nproc)makeinstallechoexportPATH=/usr/local/ruby2.4/bin:PATH’ >> /etc/profile
source /etc/profile
验证安装:
ruby -v

安装bundler
bundler-1.16.3
wget https://rubygems.org/downloads/bundler-1.16.3.gem
gem install --local bundler-1.16.3.gem

cd /home/GED-VIZ-master
vim Gemfile
注:把第一行 source 改成 http://rubygems.org
gem sources --remove https://rubygems.org/
gem sources -a http://rubygems.org/
cd GED-VIZ-master
检查一下当前源:
gem sources list
确认只有 http://rubygems.org/

在GED-VIZ-master目录下执行
bundle install
在这里插入图片描述

替换GED-VIZ-master_ok/app/models的typ_with_unit.rb
代码如下,也可以替换整个我重新编辑的项目,地址放下代码段下面:

class TypeWithUnit

  attr_accessor :type, :unit

  # Don’t initialize type and unit in the constructor
  # to allow for serialization

  # initialize accepts objects or keys for data_type, indicator_type and unit
  def initialize(options = nil)
    if options
      data_type = options[:data_type]
      indicator_type = options[:indicator_type]
      unit = options[:unit]

      if data_type.is_a? DataType
        @type = data_type
      elsif data_type
        @type = DataType.where(key: data_type).first

      elsif indicator_type.is_a? IndicatorType
        @type = indicator_type
      elsif indicator_type
        @type = IndicatorType.where(key: indicator_type).first
      end
      #raise "TypeWithUnit: no type given #{options}" unless @type

      if unit.is_a? Unit
        @unit = unit
      elsif unit
        @unit = Unit.where(key: unit).first
      end
      #raise "TypeWithUnit: no unit given #{options}" unless @unit
    end
  end

	def as_json(*args)
	  [@type&.key, @unit&.key]
	end
	
	def to_s
	  "#{
     @type&.key}(#{
     @unit&.key})"
	end