我需要gem ruby-filemagic来满足我项目中的一些要求.在运行bundle install时,它给了我这个错误
*** ERROR: missing required library to compile this module
*** extconf.rb failed ***
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题.
class State < ActiveRecord::Base
has_many :cities
end
class City < ActiveRecord::Base
has_many :zipcodes
belongs_to :state
end
class Zipcode < ActiveRecord::Base
belongs_to :city
end
Run Code Online (Sandbox Code Playgroud)
当我尝试做:
State.first.cities.zipcodes
Run Code Online (Sandbox Code Playgroud)
我收到一个ActiveRecord::Associations::CollectionProxy错误.
有没有人知道如何使用has_many关系深入多层次?我确实使用该through:选项使这个工作,但无论如何不使用该through:选项吗?