代码之家  ›  专栏  ›  技术社区  ›  victor sosa

rails命令问题

  •  1
  • victor sosa  · 技术社区  · 6 年前

    这个 rails s 指挥部在下面显示这个问题;我不知道是什么?这个项目过去运行得很好,我也没什么变化。

    [vns@betito perseus]$ rails s
    /usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = v8::Handle<v8::Value>; _Alloc = std::allocator<v8::Handle<v8::Value> >; std::vector<_Tp, _Alloc>::reference = v8::Handle<v8::Value>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
    Aborted (core dumped)
    

    我的环境:

    Fedora 28
    ruby 2.5.1
    rails 5.2.0
    libg++ 8.1.1
    

    奇怪的是,我在另一个项目中执行相同的命令,它运行得很好。

    我错过了什么?

    [vns@betito perseus]$ rails 
    The most common rails commands are:
     generate     Generate new code (short-cut alias: "g")
     console      Start the Rails console (short-cut alias: "c")
     server       Start the Rails server (short-cut alias: "s")
     test         Run tests except system tests (short-cut alias: "t")
     test:system  Run system tests
     dbconsole    Start a console for the database specified in config/database.yml
                  (short-cut alias: "db")
    
     new          Create a new Rails application. "rails new my_app" creates a
                  new application called MyApp in "./my_app"
    
    
    All commands can be run with -h (or --help) for more information.
    In addition to those commands, there are:
    
    /usr/include/c++/8/bits/stl_vector.h:932: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = v8::Handle<v8::Value>; _Alloc = std::allocator<v8::Handle<v8::Value> >; std::vector<_Tp, _Alloc>::reference = v8::Handle<v8::Value>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
    Aborted (core dumped)
    

    如果我试着按命令去做,结果它坏了。

    1 回复  |  直到 6 年前
        1
  •  0
  •   victor sosa    6 年前

    好像是这样 宝石“少轨” ';谢谢你的帮助

    我移除了gem,服务器运行良好;我必须检查是否有旧版本的gem可以工作。

    这个问题与此有关 _GLIBCXX_ASSERTIONS 在Fedora28中,编译标志默认是打开的;它会导致许多软件故障。

    Fedora 28 wiki

    Bug 1574797

    更多更新: 我发现了这个问题,它与“therubyracer”库有关 使用向量越界有一个错误。

    到这一行: 返回向量[0];

    存档:ext/v8/rr.h#L223

    现在libstdc++8.1正在检查上的断言。

    我用我自己的分支库测试了它,它正在工作。