English 中文(简体)
主动性 Admin gem
原标题:Error "different prefix:" with Active_Admin gem

我对我的宝石进行了更新,确实安装了活性——行政。

rails generate active_admin:install
rake db:migrate

之后,我想去当地:3000/admin。

我收到这一错误的页数。

ArgumentError in Active_admin/devise/sessions#new

Showing D:/Ruby192/lib/ruby/gems/1.9.1/gems/activeadmin-0.3.2/app/views/layouts/active_admin_logged_out.html.erb where line #9 raised:

different prefix: "D:/" and "C:/project/app/assets/stylesheets"
  (in C:/project/app/assets/stylesheets/active_admin.css.scss)
Extracted source (around line #9):

6:   <title><%= [@page_title, active_admin_application.site_title].compact.join(" | ") %></title>
7: 
8:   <% ActiveAdmin.application.stylesheets.each do |path| %>
9:     <%= stylesheet_link_tag path %>
10:   <% end %>
11:   <% ActiveAdmin.application.javascripts.each do |path| %>
12:     <%= javascript_include_tag path %>
Rails.root: C:/project

Application Trace | Framework Trace | Full Trace
Request

Parameters:

None
Show session dump

Show env dump

Response

Headers:

None

请注意,该项目的夹和碎块确实在不同的驱动力中(无论认为情况如何)

<><>Update:>

见http://github.com/rails/issues/660"rel=“noreferer”http://github.com/rails/issues/660。 这种办法似乎有同样的错误,但我不理解需要做些什么才能消除错误。

请帮助:

最佳回答
问题回答

The easiest way (for me at least) to work around this issue is to bundle your project gems into the project folder itself. From inside your project folder:

bundlestal-path.bundle

This installs your project s requested gems into the .bundle folder inside the project. Subsequent calls to bundle exec will remember to use this cache of gems and should mitigate against the error above.

仅将/assets/ets/* 移至您的项目/lib/assets/ ets

没有必要重新命名任何档案或依赖,因为这条道路是在任何 path路之前。

您可以通过发射铁路线(rails c)来检查您的资产路径,并落实如下:y Railways.application.config.assets.paths

我设法围绕以下方面开展工作:

1) Copy the folder with stylesheets from active admin gem folder to your app s assetes, i have it here: c:RailsInstallerRuby1.9.2lib ubygems1.9.1gemsactiveadmin-0.3.2appassetsstylesheetsactive_admin

2) 将资产中的这种组合重新命名为“米_active_admin”(青年可以放弃“活性——行政”——这赢得了笔工作)。

3) 将“主动行政”改为“米_active_admin”。

并且确实忘记去除/固定在应用中要求树。 c 如果你使用。

Voila! 1. 更新行政网页而不担心=

Though I don t like such solutions much in terms of need for excessive hacks... BUT now you can freely customize look and feel of the active admin, and it turns to be not the hack for the bug, but for the feature =)





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签