Ruby on Rails:“找不到文件‘jquery-ui’" [英] Ruby on Rails: "couldn't find file 'jquery-ui'"

查看:27
本文介绍了Ruby on Rails:“找不到文件‘jquery-ui’"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚完成了全新安装并且能够访问 localhost:3000 的默认 rails 页面,但是当我安装了 activeadmin gem 时,我在访问/admin/时遇到了问题,并在/admin/上收到了以下错误登录(我被重定向了,但这是我在页面上看到的:)

我该怎么办?我已经完成了捆绑更新,但没有修复它.

这是部分错误消息:

<块引用>

Sprockets::FileNotFound in Active_admin/devise/sessions#new

显示/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activeadmin->0.6.0/app/views/layouts/active_admin_logged_out.html.erb 其中第 12 行:

找不到文件'jquery-ui'(在/usr/local/rvm/gems/ruby-1.9.3-p392/gems/activeadmin->0.6.0/app/assets/javascripts/active_admin/base.js:2)

这是我的 gem 文件:

source 'https://rubygems.org'宝石导轨",3.2.12"# 改为捆绑边缘 Rails:# gem 'rails', :git =>'git://github.com/rails/rails.git'宝石'sqlite3'# Gems 仅用于资产,不是必需的# 默认在生产环境中.组:资产做gem 'sass-rails', '~>3.2.3'gem '咖啡轨','~>3.2.1'# 有关更多支持的运行时,请参阅 https://github.com/sstephenson/execjs#readme# gem 'therubyracer', :platforms =>:红宝石gem 'uglifier', '>= 1.0.3'结尾宝石'jquery-rails'宝石'activeadmin'# 使用 ActiveModel has_secure_password# gem 'bcrypt-ruby', '~>3.0.0'# 为 JSON 使用 Jbuilder 模板# gem 'jbuilder'# 使用独角兽作为应用服务器# gem '独角兽'# 使用 Capistrano 部署# gem 'capistrano'# 使用调试器# gem '调试器'

解决方案

这是一个已知问题 由于 jquery-rails 依赖项放弃了 jQuery-UI 支持.目前的解决方法似乎是强制 jquery-rails gem 使用 2.3.0 版加载:

gem 'jquery-rails', '~>2.3.0'

由此产生的相关问题:在 Rails 中调试 jQueryUI 版本.>

I've just done a fresh install and was able to access the default rails page at localhost:3000, but when I installed the activeadmin gem I had a problem when accessing /admin/ and received the following error on /admin/login (I was redirected, but this is what I saw on the page:)

What do I do? I have done bundle update and it's not fixed it.

Here's the partial error message:

Sprockets::FileNotFound in Active_admin/devise/sessions#new

Showing /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activeadmin->0.6.0/app/views/layouts/active_admin_logged_out.html.erb where line #12 raised:

couldn't find file 'jquery-ui' (in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/activeadmin->0.6.0/app/assets/javascripts/active_admin/base.js:2)

here is my gem file:

source 'https://rubygems.org'

gem 'rails', '3.2.12'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# 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', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'
gem 'activeadmin'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

解决方案

This is a known issue due to the jquery-rails dependency dropping jQuery-UI support. The workaround for the moment appears to be to force the jquery-rails gem to load using version 2.3.0:

gem 'jquery-rails', '~> 2.3.0'

A related problem due to this: Debug jQueryUI Versions in Rails.

这篇关于Ruby on Rails:“找不到文件‘jquery-ui’"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆