【问题标题】:Padre complains about an SQLite database issuePadre 抱怨 SQLite 数据库问题
【发布时间】:2016-01-14 10:45:58
【问题描述】:

我从 perl 开始,想在 Ubuntu 14.04 上安装 IDE PadreThe answers in this question表示我可以简单地使用apt-get

sudo apt-get install padre

我也尝试安装它:

sudo cpan Padre

here所示。

但是,当我运行 padre 时,它给了我以下错误:

DBD::SQLite::db selectall_arrayref failed: attempt to write a readonly database at (eval 1905) line 41.
Perl exited with active threads:
    1 running and unjoined
    0 finished and unjoined
    0 running and detached

当我以 root (sudo padre) 运行它时:

DBD::SQLite::db do failed: Safety level may not be changed inside a transaction at (eval 1905) line 37.
Perl exited with active threads:
    1 running and unjoined
    0 finished and unjoined
    0 running and detached

padre --version 显示:Perl Application Development and Refactoring Environment 1.00,而我的 perl 版本是 5.18.2。

/usr/bin/padre 脚本中,我没有看到对 SQLite 数据库的任何引用。有谁知道我该如何解决这个问题?

【问题讨论】:

    标签: perl sqlite ubuntu-14.04 padre


    【解决方案1】:

    最后我在this bug report 找到了解决方案。在文件Locker.pm(在我的系统中位于/usr/share/perl5/Padre)中,应该更改以下函数(第102行):

    sub db_increment {
        my $self = shift;
        unless ( $self->{db_depth}++ ) {
            Padre::DB->begin;    
            # ...
            Padre::DB->pragma( synchronous => 0 );
        }
        return;
    }
    

    到:

    sub db_increment {
        my $self = shift;
        unless ( $self->{db_depth}++ ) {
            #...
            Padre::DB->pragma( synchronous => 0 );
            Padre::DB->begin;
        }
        return;
    }
    

    即更改Padre::DB->pragmaPadre::DB->begin 的顺序。

    这允许我以 root (sudo) 身份启动 padre,为了解决这个问题,我必须更改 Padre 配置的所有者。我使用chown更改了我的用户的权限:

    sudo chown -R myuser:myuser /.local/share/.padre/
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-17
      • 1970-01-01
      • 2013-05-06
      • 2017-10-22
      • 2014-07-11
      • 2011-05-15
      • 1970-01-01
      相关资源
      最近更新 更多