无法在当前包中找到gem'uglifier' [英] Could not find gem 'uglifier' in the current bundle

查看:159
本文介绍了无法在当前包中找到gem'uglifier'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的简单网络应用程序在Windows 7上运行正常。现在我将它移动到bluehost。



启动应用程序时出现此错误:

  ActionView :: Template :: Error(无法加载此文件 -  uglifier 

试图解决它我已经运行了'gem install uglifier',并且似乎主要工作:

  SSH#gem install uglifier 
成功安装uglifier-1.3.0
1已安装gem
为uglifier-1.3.0安装ri文档...
无法转换\ xC2转换为UTF-8转换为ASCII-8BIT转换为UTF-8转换为US-ASCII转换为README.md,跳过
安装uglifier-1.3.0的RDoc文档...
无法将README.md中的\xC2转换为UTF-8转换为ASCII-8BIT转换为UTF-8转换为US-ASCII,跳过

但是当我尝试找到宝石时,找不到它:

  bundle show uglifier 

产量:
Coul d在当前包中找不到gem'uglifier'



Gemfile包含以下内容:

  group:assets do 
gem'therubyracer'
gem'sass-rails','〜> 3.2.3'
gem'咖啡栏','〜> 3.2.1'
gem'uglifier','> = 1.0.3'
结束

和Gemfile.lock显示uglifier gem已安装:

  uglifier(1.3.0)

$ PATH信息:

  /usr/local/jdk/bin:/home4/mychairs/perl5/bin:/usr/lib64/qt-3.3/bin:/home4/mychairs/perl5/bin:/ramdisk/bin:/usr/斌:/ bin中:在/ usr / local / sbin中:/ usr / sbin目录:/ sbin目录:在/ usr / local / bin目录:在/ usr / X11R6 / bin中:/ home4 / mychairs /红宝石/宝石/斌:/ home4 / mychairs / ruby / gems:/ home4 / mychairs / bin 


解决方案

首先你需要将Gem添加到你的Rails应用程序根目录下的Gemfile。请参阅 Bundler

只需在您的Gemfile的资产组中包含uglifier gem即可:



Gemfile
















code>

然后运行 bundle install 命令来安装所有必需的gem。您可以通过查看Gemfile.lock文件来确认安装了哪些gem,包括版本信息。

如果您还没有资产组,请创建一个。我强烈建议阅读bundler。

My simple web app runs ok on Windows 7. Now I am moving it to bluehost.

Getting this error when starting the app:

ActionView::Template::Error (cannot load such file -- uglifier

Trying to resolve it I have run 'gem install uglifier' and seems to mostly work:

SSH# gem install uglifier
Successfully installed uglifier-1.3.0
1 gem installed
Installing ri documentation for uglifier-1.3.0...
unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII  for README.md, skipping
Installing RDoc documentation for uglifier-1.3.0...
unable to convert "\xC2" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.md, skipping

But when I try to locate the gem, it is not found:

bundle show uglifier

yields: Could not find gem 'uglifier' in the current bundle

Gemfile includes the following:

group :assets do
  gem 'therubyracer'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

and Gemfile.lock shows that the uglifier gem is installed:

uglifier (1.3.0)

$PATH information:

/usr/local/jdk/bin:/home4/mychairs/perl5/bin:/usr/lib64/qt-3.3/bin:/home4/mychairs/perl5/bin:/ramdisk/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home4/mychairs/ruby/gems/bin:/home4/mychairs/ruby/gems:/home4/mychairs/bin

解决方案

For starters you need to add the gem to your Gemfile at the root of your Rails application. See Bundler.

Simply include the uglifier gem somewhere in the assets group of your Gemfile:

Gemfile

group :assets do
  gem 'uglifier'
end 

Then you run the bundle install command to install all of the required gems. You can confirm exactly what gems are installed including version information by looking at the Gemfile.lock file.

If you don't already have an assets group then make one. I highly recommend reading up on bundler.

这篇关于无法在当前包中找到gem'uglifier'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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