Ruby 受保护的方法`授权';要求#<;管理员::CustomerController:0x750c540>;
我的这些问题真的让我烦透了。Ruby 受保护的方法`授权';要求#<;管理员::CustomerController:0x750c540>;,ruby,ruby-on-rails-3,activeadmin,cancan,Ruby,Ruby On Rails 3,Activeadmin,Cancan,我的这些问题真的让我烦透了。 我试着让activeadmin与CanCan一起工作。用户模型和我为不同的角色创建一个子类。 使用者 如果你能帮我做这件事,我会非常健忘的 这是档案 source 'http://rubygems.org' ruby '1.9.3' gem 'rails', '3.2.17' gem 'actionmailer', '3.2.17' # sass-rails gem 'sass-rails', '>= 3.2' # sass-rails depends
我试着让activeadmin与CanCan一起工作。用户模型和我为不同的角色创建一个子类。
使用者 如果你能帮我做这件事,我会非常健忘的 这是档案
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.17'
gem 'actionmailer', '3.2.17'
# sass-rails
gem 'sass-rails', '>= 3.2'
# sass-rails depends on [sass (>= 3.1.10)]
gem 'sass', '3.2.8' # Version 3.3.4 create error in Rake jobs:work
# bootstrap-sass
gem 'bootstrap-sass', '3.0.0'
# font-awesome
gem 'font-awesome-sass', '~> 4.0.2'
# CanCan is an authorization library for Ruby on Rails which
# restricts what resources a given user is allowed to access.
# https://github.com/ryanb/cancan/
gem 'cancancan', '1.8.2'
gem 'devise', '2.2.3'
gem 'devise-async', '0.7.0'
# Delayed_job (or DJ) encapsulates the common pattern of
# asynchronously executing longer tasks in the background.
gem 'delayed_job_active_record', '0.3.2'
#gem 'dj_mon', :git => 'git://github.com/jrosesol/dj_mon.git'
# HStore gem (to use NO SQL)
gem 'activerecord-postgres-hstore', '0.4.1'#git: 'git://github.com/softa/activerecord-postgres-hstore.git',
# Geocoder gem to place requests to Google's MAP API
gem 'geocoder', '1.1.8'
# Google place API implementation
# https://github.com/marceldegraaf/google_places
gem 'google_places', '0.18.0'
# Bundles some javascript files to make them available to your application backbone/underscore/json2
# https://github.com/aflatter/backbone-rails
gem "rails-backbone", "0.7.2"
#################
# RABL (Ruby API Builder Language) is a Rails and Padrino ruby templating system for generating JSON, XML, MessagePack, PList and BSON.
# https://github.com/nesquena/rabl
#
#gem 'rabl', '0.7.9'
# Also add either `oj` or `yajl-ruby` as the JSON parser
#gem 'oj', '1.4.6'
#################
# Easiest way to add multi-environment yaml settings to Rails3
# https://github.com/railsjedi/rails_config
gem 'rails_config', '0.3.3'
# Using Postgres database gem
gem 'pg', '0.14.1'
#
gem 'will_paginate', '3.0.3'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
# jQuery JavaScript Library v1.8
gem 'jquery-rails', '2.1'
# TODO: Should be in the 'TEST' group but there is a bug fixed in rubymine 5.0, change when possible
# http://youtrack.jetbrains.com/issue/RUBY-12632
gem 'rspec', :require => false
group :development, :test do
gem 'rspec-rails', '2.12.2'
gem 'capybara', '2.0.2'
gem 'launchy', '2.2.0'
gem 'annotate', '~> 2.4.1.beta'
gem 'quiet_assets', '1.0.2'
gem 'factory_girl', '4.2.0'
gem 'database_cleaner'
gem 'shoulda'
# Generate fake data for your project test
gem 'faker', '1.0.1'
gem 'i18n-tasks', '~> 0.3.11' #Simplifying Translations
gem 'simplecov', '0.8.2' #to have the coverage for the tests
end
# Add CSS inline for outgoing email (requires Bundler 1.2 pre+))
gem 'premailer-rails', '1.7'
# Daemon is require to run delayed_jobs scripts in Unix systems
gem 'daemons', '1.1.9'
# Captcha for wizard
gem "recaptcha", '0.3.5', :require => "recaptcha/rails"
# For search engine indexing (Sitemap.xml)
gem 'sitemap_generator', '4.2.0'
# This is for crawling/webscraping
#https://github.com/fizx/robots
gem 'robots', '0.10.1'
#http://nokogiri.org/
gem 'nokogiri', '1.6.2.1'
#https://github.com/chriskite/anemone/tree/master
gem 'anemone', '0.7.2'
# Application monitoring
gem 'newrelic_rpm', '3.9.0.229'
# For passing data to javascript files
gem 'gon', '5.0.4'
# For autocomplete-search boxes
gem 'select2-rails', '3.5.7'
gem 'json', '1.8.1'
platform :ruby do #linux only
group :production, :staging do
gem 'unicorn', '4.8.3'
end
end
# These are used to store the logo of a company into s3 amazon
gem 'paperclip' , '4.1.1'
gem 'aws-sdk' , '1.43.2'
gem 'activeadmin'
gem 'meta_search'
gem 'activeadmin-cancan'
使用
gem'cancancan'
而不是gem'cancan'
,并删除gem'activeadmin cancan'
,您不必使用该gem。别忘了更新你的gems:捆绑更新
本来可以,但我已经使用gem cancancan gem'cancancan'、'1.8.2'gem'designe'、'2.2.3'gem'designe async'、'0.7.0'我应该显示我的gemfile是的,gemfile会很有帮助,和Rails的版本。gem文件现在在这里,请同时尝试这两种方法:不建议使用gem'cancan'gem'cancancan'bundle update
,因为这可能会导致gems兼容性问题<代码>捆绑安装就足够了
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', '3.2.17'
gem 'actionmailer', '3.2.17'
# sass-rails
gem 'sass-rails', '>= 3.2'
# sass-rails depends on [sass (>= 3.1.10)]
gem 'sass', '3.2.8' # Version 3.3.4 create error in Rake jobs:work
# bootstrap-sass
gem 'bootstrap-sass', '3.0.0'
# font-awesome
gem 'font-awesome-sass', '~> 4.0.2'
# CanCan is an authorization library for Ruby on Rails which
# restricts what resources a given user is allowed to access.
# https://github.com/ryanb/cancan/
gem 'cancancan', '1.8.2'
gem 'devise', '2.2.3'
gem 'devise-async', '0.7.0'
# Delayed_job (or DJ) encapsulates the common pattern of
# asynchronously executing longer tasks in the background.
gem 'delayed_job_active_record', '0.3.2'
#gem 'dj_mon', :git => 'git://github.com/jrosesol/dj_mon.git'
# HStore gem (to use NO SQL)
gem 'activerecord-postgres-hstore', '0.4.1'#git: 'git://github.com/softa/activerecord-postgres-hstore.git',
# Geocoder gem to place requests to Google's MAP API
gem 'geocoder', '1.1.8'
# Google place API implementation
# https://github.com/marceldegraaf/google_places
gem 'google_places', '0.18.0'
# Bundles some javascript files to make them available to your application backbone/underscore/json2
# https://github.com/aflatter/backbone-rails
gem "rails-backbone", "0.7.2"
#################
# RABL (Ruby API Builder Language) is a Rails and Padrino ruby templating system for generating JSON, XML, MessagePack, PList and BSON.
# https://github.com/nesquena/rabl
#
#gem 'rabl', '0.7.9'
# Also add either `oj` or `yajl-ruby` as the JSON parser
#gem 'oj', '1.4.6'
#################
# Easiest way to add multi-environment yaml settings to Rails3
# https://github.com/railsjedi/rails_config
gem 'rails_config', '0.3.3'
# Using Postgres database gem
gem 'pg', '0.14.1'
#
gem 'will_paginate', '3.0.3'
# 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'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
# jQuery JavaScript Library v1.8
gem 'jquery-rails', '2.1'
# TODO: Should be in the 'TEST' group but there is a bug fixed in rubymine 5.0, change when possible
# http://youtrack.jetbrains.com/issue/RUBY-12632
gem 'rspec', :require => false
group :development, :test do
gem 'rspec-rails', '2.12.2'
gem 'capybara', '2.0.2'
gem 'launchy', '2.2.0'
gem 'annotate', '~> 2.4.1.beta'
gem 'quiet_assets', '1.0.2'
gem 'factory_girl', '4.2.0'
gem 'database_cleaner'
gem 'shoulda'
# Generate fake data for your project test
gem 'faker', '1.0.1'
gem 'i18n-tasks', '~> 0.3.11' #Simplifying Translations
gem 'simplecov', '0.8.2' #to have the coverage for the tests
end
# Add CSS inline for outgoing email (requires Bundler 1.2 pre+))
gem 'premailer-rails', '1.7'
# Daemon is require to run delayed_jobs scripts in Unix systems
gem 'daemons', '1.1.9'
# Captcha for wizard
gem "recaptcha", '0.3.5', :require => "recaptcha/rails"
# For search engine indexing (Sitemap.xml)
gem 'sitemap_generator', '4.2.0'
# This is for crawling/webscraping
#https://github.com/fizx/robots
gem 'robots', '0.10.1'
#http://nokogiri.org/
gem 'nokogiri', '1.6.2.1'
#https://github.com/chriskite/anemone/tree/master
gem 'anemone', '0.7.2'
# Application monitoring
gem 'newrelic_rpm', '3.9.0.229'
# For passing data to javascript files
gem 'gon', '5.0.4'
# For autocomplete-search boxes
gem 'select2-rails', '3.5.7'
gem 'json', '1.8.1'
platform :ruby do #linux only
group :production, :staging do
gem 'unicorn', '4.8.3'
end
end
# These are used to store the logo of a company into s3 amazon
gem 'paperclip' , '4.1.1'
gem 'aws-sdk' , '1.43.2'
gem 'activeadmin'
gem 'meta_search'
gem 'activeadmin-cancan'