简体   繁体   English

Active Admin输入错误-Ruby on Rails

[英]Type Error with Active Admin - Ruby on Rails

I am new to Ruby on Rails(4.1.8) and using OS Windows 8, I have added the gem activeadmin in my gemfile and ran commands 我是Ruby on Rails(4.1.8)的新手,并使用OS Windows 8,已在gemfile中添加了gem activeadmin并运行了命令

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

but I get the following exception while running http://localhost:3000/admin 但是在运行http:// localhost:3000 / admin时出现以下异常

TypeError: Object doesn't support this property or method (in c:/Sites/CleverChalk/app/assets/javascripts/active_admin.js.coffee) TypeError:对象不支持此属性或方法(在c:/Sites/CleverChalk/app/assets/javascripts/active_admin.js.coffee中)

Could someone please advise why this occurs. 有人可以告诉为什么会这样。 i read a couple of post on coffee-script-source and coffee-rails but they have not worked for me. 我看了几篇关于coffee-script-sourcecoffee-rails但它们对我没有用。

My Gemfile is as below : 我的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]

I could resolve the issue by reinstalling activeadmin with Users that meant adding the devise gem as shown below: 我可以通过用Users重新安装activeadmin来解决此问题,这意味着添加devise gem,如下所示:

gem 'devise' 

to the gemfile and then 到gemfile然后

bundle install
rails generate devise:install

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM