Sinatra Ruby 1.9.2因“非法指令”失败

时间:2011-08-11 19:00:02

标签: ruby sinatra

我正在制作我正在制作的sinatra应用程序。

导致此问题的代码行是:

<% @user.grades.each do |grade| %>
    <%= grade.enrollment.m_class.score %>
<% end %>

这是我的模特:

module Models   
 class MClass < ActiveRecord::Base
     belongs_to :school
     has_many :users, :through => :enrollments
 end
end

module Models
class Enrollment < ActiveRecord::Base
  belongs_to :user
 belongs_to :class
end
end

module Models
 class Grade < ActiveRecord::Base
     belongs_to :enrollment
 end
end

module Models
  class School < ActiveRecord::Base
   has_many :assignments
   has_many :users
   has_many :reports
 end
end

应用程序启动正常,但加载页面会执行此操作:

Antonio-Diazs-MacBook-Pro:gradstr anton$ ruby gradstr_core.rb
== Sinatra/1.2.6 has taken the stage on 4567 for development with backup from Mongrel    Illegal instruction
Antonio-Diazs-MacBook-Pro:gradstr anton$

我不知道问题是什么,提前感谢您的帮助。

0 个答案:

没有答案