使用Active Admin键入错误 - Ruby on Rails

时间:2015-10-24 16:44:24

标签: ruby-on-rails ruby ruby-on-rails-4 coffeescript

我是Ruby on Rails(4.1.8)的新手,使用OS Windows 8,我在gemfile中添加了gem activeadmin并运行命令

rails g active_admin:install --skip-users
rake db:migrate
rails server

但在运行http://localhost:3000/admin

时出现以下异常
  

TypeError:对象不支持此属性或方法(in   C:/Sites/CleverChalk/app/assets/javascripts/active_admin.js.coffee)

有人可以告诉你为什么会这样。我读了几篇文章  coffee-script-source和  coffee-rails但他们没有为我工作。

我的Gemfile如下:

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use sqlite3 as the database for Active Record
#gem 'sqlite3'
gem 'pg'
gem 'activeadmin', github: 'activeadmin'
gem 'coffee-script-source', '1.8.0'
gem 'coffee-rails', '~> 4.0.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]

1 个答案:

答案 0 :(得分:0)

我可以通过向用户重新安装activeadmin来解决这个问题,这意味着添加了如下所示的设计gem:

gem 'devise' 

到gemfile然后

bundle install
rails generate devise:install

感谢。