Ruby on Rails:[BUG] Segmentation fault ruby​​ 1.8.7(2011-06-30 patchlevel 352)[x86_64-linux]

时间:2013-02-21 05:25:41

标签: ruby-on-rails rails-activerecord

我在rails之外使用Active Record。我在

创建了一个rb文件
/usr/share/puppet-dashboard/bin/process.rb

process of process.rb

#!/usr/bin/ruby

require 'rubygems'
gem 'mysql2'
gem 'activerecord'

require 'active_record'

ActiveRecord::Base.establish_connection(
  :adapter  => "mysql2",
  :host     => "localhost",
  :username => "root",
  :password => "root123",
  :database => "testproject_development"
)

但是当我运行这个rb文件时,我收到以下错误: -

/usr/local/rvm/gems/ruby-1.9.3-p362@artwork_auto/gems/json-1.7.7/lib/json/ext/parser.so: 
[BUG] Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

如何解决此问题。

1 个答案:

答案 0 :(得分:0)

从这里开始:https://www.ruby-forum.com/topic/4411143

尝试更改你的shebang以防止你的版本混淆。

{{{

!/ usr / bin / env ruby​​

}}}