1

我安装了 Hirb,并且想要它附带的漂亮的表格视图。我检查了 pry、Rails 和 Hirb 的版本,它们应该可以工作。我也尝试重新安装 gems。运行后我看不到漂亮的景色Hirb.enable

➜  awections git:(master) ✗ rails c
/Users/RJ/.rvm/gems/ruby-2.1.3/gems/activesupport-    4.2.0/lib/active_support/dependencies.rb:274:in `require'
2.1.3 (main):0 > Hirb.enable
=> true
2.1.3 (main):0 > Product.all
  Product Load (1.0ms)  SELECT "products".* FROM "products"
=> [#<Product:0x007fb8fec3b838
  id: 1,
  name: "Hammer",
  image: "http://s.hswstatic.com/gif/hammer-1.jpg",
  created_at: Fri, 05 Jun 2015 19:48:19 UTC +00:00,
  updated_at: Fri, 05 Jun 2015 19:48:19 UTC +00:00,
  user_id: nil>,
 #<Product:0x007fb8fec3b680
  id: 2,
  name: "Screw Driver",
  image: "http://images.clipartpanda.com/screwdriver-clipart-free-vector-bigredsmile-a-screwdriver-clip-art_115848_Bigredsmile_A_Screwdriver_clip_art_hight.png",
  created_at: Fri, 05 Jun 2015 19:49:13 UTC +00:00,
  updated_at: Fri, 05 Jun 2015 19:49:13 UTC +00:00,
  user_id: nil>]
2.1.3 (main):0 >

任何见解将不胜感激。

4

0 回答 0