ruby-on-rails - rails 命令问题

标签 ruby-on-rails ruby linux ruby-on-rails-5

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)

如果我尝试使用该命令,它会起作用,但最后会坏掉。

最佳答案

似乎是这个'gem "less-rails"';谢谢你的帮助

我删除了 gem,服务器运行正常;我必须检查是否有适用于此的旧版本。

问题与此有关 _GLIBCXX_ASSERTIONS Fedora 28 默认打开编译标志;并导致很多软件故障。

Fedora 28 wiki

Bug 1574797

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

到这一行: 返回 &vector[0];

在文件中:ext/v8/rr.h#L223

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

我使用自己的分支库对其进行了测试,它可以正常工作。

关于ruby-on-rails - rails 命令问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51661931/

相关文章:

javascript - 从sqlite db获取图像并使用JavaScript显示在页面上

ruby-on-rails - 数据密集型应用程序的 RESTful Web 服务与 Socket 编程

ruby - 强制 ruby gem 使用替代 gem 源

ruby-on-rails - 模拟/ stub "instance.extend(DecoratorModule)"中包含的方法

ruby - Rails - 未定义的方法 `authenticate'

java - logstash 运行程序错误

linux - 在循环中选择 - 一直工作 - linux

ruby-on-rails - FactoryGirl build_stubbed & RSpec - 生成 ID 但在测试 Show 操作时找不到 ID

ruby-on-rails - 如何复数 “There is/are N object/objects”?

linux - 为什么Qt中的MainWindow在启动程序后关闭?