rails_admin不显示视图/编辑控件

时间:2014-08-10 17:44:31

标签: ruby-on-rails ruby-on-rails-3 activerecord rails-admin

我在生产服务器上使用Ruby 1.9.3p194和rails_admin 0.3.0有一个遗留的Rails应用3.2.14。工作正常。

我将这个传统的Rails应用程序迁移到新服务器并让应用程序启动,到目前为止很少有问题。我遇到的主要问题之一是使用rails_admin。当我以管理员用户身份登录时,我可以看到所有模型/表格,但在选择表格时,我会看到一个记录列表,但没有用于编辑/查看每条记录的控件。

enter image description here

添加新记录不是问题,rails_admin行为正常。但我无法查看或编辑特定记录。

它可以在我们的生产服务器上运行,但是当我把它推到这个新服务器时(这几乎是一个相同的环境,而不是在64位Ubuntu和生产中的32位Ubuntu)我看不到任何控件编辑记录。

我只是不确定它为何在生产中运行,但在部署到第二台服务器时出现此问题。

这是我的Gemfile

source 'https://rubygems.org'

# Bundle edge Rails instead:
gem 'rails',  '~> 3.2.13'
gem 'pg', "~> 0.14.0"
gem 'thin', "~> 1.4.1"
gem 'devise', "~> 2.1.2"
gem "combined_time_select", "~> 0.0.1"
gem "will_paginate", "~> 3.0.3"
gem 'whenever', "~> 0.7.3", :require => false
gem "gritter", "1.0.2"
gem "rails_admin", "~> 0.3.0"
gem "twitter-bootstrap-rails", "~> 2.2.1"
gem "will_paginate-bootstrap", "~> 0.2.2"
gem "prawn"
gem 'twilio-ruby', '~> 3.11.6'
gem 'font-awesome-rails', '~> 4.1.0.0'

group :development do
  gem "annotate", "~> 2.5.0"
  gem "better_errors", "~> 0.3.2"
  gem "binding_of_caller"
end

gem "gmaps4rails", "~> 2.0.0.pre"
gem "taip_parser", "~> 0.0.1"
gem "foreman", "~> 0.60.0"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'therubyracer', '~> 0.12.1', :platforms => :ruby
 # gem 'therubyracer', '~> 0.10.2', :platforms => :ruby
  gem 'uglifier', '>= 1.0.3'
  gem 'jquery-datatables-rails'
end

gem "less-rails" #Sprockets (what Rails 3.1 uses for its asset pipeline) supports LESS
gem 'jquery-rails'

# Deploy with Capistrano
gem 'capistrano'

#Monitor app with newrelic
gem 'newrelic_rpm'

这是我的Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    Ascii85 (1.0.2)
    actionmailer (3.2.14)
      actionpack (= 3.2.14)
      mail (~> 2.5.4)
    actionpack (3.2.14)
      activemodel (= 3.2.14)
      activesupport (= 3.2.14)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.14)
      activesupport (= 3.2.14)
      builder (~> 3.0.0)
    activerecord (3.2.14)
      activemodel (= 3.2.14)
      activesupport (= 3.2.14)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.14)
      activemodel (= 3.2.14)
      activesupport (= 3.2.14)
    activesupport (3.2.14)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    afm (0.2.0)
    annotate (2.5.0)
      rake
    arel (3.0.2)
    bcrypt-ruby (3.0.1)
    better_errors (0.3.2)
      coderay (>= 1.0.0)
      erubis (>= 2.7.0)
    binding_of_caller (0.7.2)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (2.1.1.0)
    builder (3.0.4)
    capistrano (2.12.0)
      highline
      net-scp (>= 1.0.0)
      net-sftp (>= 2.0.0)
      net-ssh (>= 2.0.14)
      net-ssh-gateway (>= 1.1.0)
    chronic (0.6.7)
    coderay (1.1.0)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.3.3)
    combined_time_select (0.0.1)
    commonjs (0.2.6)
    daemons (1.1.8)
    debug_inspector (0.0.2)
    devise (2.1.2)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.1)
      railties (~> 3.1)
      warden (~> 1.2.1)
    erubis (2.7.0)
    eventmachine (0.12.10)
    execjs (1.4.0)
      multi_json (~> 1.0)
    font-awesome-rails (4.1.0.0)
      railties (>= 3.2, < 5.0)
    font-awesome-sass-rails (2.0.0.0)
      railties (>= 3.1.1)
      sass-rails (>= 3.1.1)
    foreman (0.60.0)
      thor (>= 0.13.6)
    gmaps4rails (2.0.0.pre)
    gritter (1.0.2)
    haml (3.1.7)
    hashery (2.1.0)
    highline (1.6.13)
    hike (1.2.3)
    i18n (0.6.5)
    journey (1.0.4)
    jquery-datatables-rails (1.10.0)
      jquery-rails
    jquery-rails (2.1.4)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (2.0.2)
      jquery-rails
      railties (>= 3.1.0)
    json (1.8.0)
    jwt (1.0.0)
    kaminari (0.14.1)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    less (2.2.2)
      commonjs (~> 0.2.6)
    less-rails (2.2.6)
      actionpack (>= 3.1)
      less (~> 2.2.0)
    libv8 (3.16.14.3)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.25)
    multi_json (1.8.0)
    nested_form (0.3.1)
    net-scp (1.0.4)
      net-ssh (>= 1.99.1)
    net-sftp (2.0.5)
      net-ssh (>= 2.0.9)
    net-ssh (2.5.2)
    net-ssh-gateway (1.1.0)
      net-ssh (>= 1.99.1)
    newrelic_rpm (3.6.5.130)
    nokogiri (1.5.6)
    orm_adapter (0.4.0)
    pdf-reader (1.3.3)
      Ascii85 (~> 1.0.0)
      afm (~> 0.2.0)
      hashery (~> 2.0)
      ruby-rc4
      ttfunk
    pg (0.14.0)
    polyglot (0.3.3)
    prawn (0.12.0)
      pdf-reader (>= 0.9.0)
      ttfunk (~> 1.0.2)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-pjax (0.6.0)
      nokogiri (~> 1.5)
      rack (~> 1.3)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.14)
      actionmailer (= 3.2.14)
      actionpack (= 3.2.14)
      activerecord (= 3.2.14)
      activeresource (= 3.2.14)
      activesupport (= 3.2.14)
      bundler (~> 1.0)
      railties (= 3.2.14)
    rails_admin (0.3.0)
      bootstrap-sass (~> 2.1)
      builder (~> 3.0)
      coffee-rails (~> 3.1)
      font-awesome-sass-rails (~> 2.0)
      haml (~> 3.1)
      jquery-rails (~> 2.1)
      jquery-ui-rails (~> 2.0)
      kaminari (~> 0.14)
      nested_form (> 0.2.3, < 0.4.0)
      rack-pjax (~> 0.6)
      rails (~> 3.1)
      remotipart (~> 1.0)
      sass-rails (~> 3.1)
    railties (3.2.14)
      actionpack (= 3.2.14)
      activesupport (= 3.2.14)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.1.0)
    rdoc (3.12.2)
      json (~> 1.4)
    ref (1.0.5)
    remotipart (1.0.2)
    ruby-rc4 (0.1.5)
    sass (3.1.20)
    sass-rails (3.2.5)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    taip_parser (0.0.1)
    therubyracer (0.12.1)
      libv8 (~> 3.16.14.0)
      ref
    thin (1.4.1)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.18.1)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    ttfunk (1.0.3)
    twilio-ruby (3.11.6)
      builder (>= 2.1.2)
      jwt (>= 0.1.2)
      multi_json (>= 1.3.0)
    twitter-bootstrap-rails (2.2.1)
      actionpack (>= 3.1)
      execjs
      railties (>= 3.1)
    tzinfo (0.3.37)
    uglifier (1.2.6)
      execjs (>= 0.3.0)
      multi_json (~> 1.3)
    warden (1.2.1)
      rack (>= 1.0)
    whenever (0.7.3)
      activesupport (>= 2.3.4)
      chronic (~> 0.6.3)
    will_paginate (3.0.3)
    will_paginate-bootstrap (0.2.2)
      will_paginate (>= 3.0.3)

PLATFORMS
  ruby

DEPENDENCIES
  annotate (~> 2.5.0)
  better_errors (~> 0.3.2)
  binding_of_caller
  capistrano
  coffee-rails (~> 3.2.1)
  combined_time_select (~> 0.0.1)
  devise (~> 2.1.2)
  font-awesome-rails (~> 4.1.0.0)
  foreman (~> 0.60.0)
  gmaps4rails (~> 2.0.0.pre)
  gritter (= 1.0.2)
  jquery-datatables-rails
  jquery-rails
  less-rails
  newrelic_rpm
  pg (~> 0.14.0)
  prawn
  rails (~> 3.2.13)
  rails_admin (~> 0.3.0)
  sass-rails (~> 3.2.3)
  taip_parser (~> 0.0.1)
  therubyracer (~> 0.12.1)
  thin (~> 1.4.1)
  twilio-ruby (~> 3.11.6)
  twitter-bootstrap-rails (~> 2.2.1)
  uglifier (>= 1.0.3)
  whenever (~> 0.7.3)
  will_paginate (~> 3.0.3)
  will_paginate-bootstrap (~> 0.2.2)

1 个答案:

答案 0 :(得分:1)

您需要从gemfile中删除gem 'font-awesome-rails', '~> 4.1.0.0'并运行bundle install

实际上rails_admin使用Bootstrap 2和FontAwesome 3.但是你要从gemfile安装FontAwesome 4。它导致宝石版本的冲突。 RailsAdmin使用旧式语法(例如&#39; icon icon-pencil&#39;)而不是新式(例如&#39; fa fa-pencil&#39;)。因此,图标没有显示出来。

您可以在没有FontAwesome 4的情况下生活,只需删除它即可。

杰夫也有same problem