我在 Rails 外使用 Active Record。我创建了一个 rb 文件
/usr/share/puppet-dashboard/bin/process.rb
进程代码.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]
如何解决这个问题。