草庐IT

install_language_pack_gems

全部标签

ruby - Gem 在 irb 中加载但不在控制台中加载

这个让我抓狂。我可以通过irb加载gem:steve@server:/var/www/listings$irbirb(main):001:0>Gem.path=>["/home/steve/.gem/ruby/1.9.1","/usr/local/ruby/lib/ruby/gems/1.9.1"]irb(main):002:0>require'nokogiri'=>true但我无法通过Rails控制台加载它:irb(main):001:0>Gem.path=>["/home/steve/.gem/ruby/1.9.1","/usr/local/ruby/lib/ruby/gems/1

ruby - 融合表 : Why do I keep getting a "400 Bad Request" error when trying to update a table style via Ruby's RestClient gem

我正在尝试使用RubygemRestClient为我的一个FusionTables更新样式。这是我的代码:require'rest_client'tableId=''styleId=''key=''table_url="https://www.googleapis.com/fusiontables/v1/tables/#{tableId}/styles/#{styleId}?key=#{key}"update='{"polygonOptions":{"strokeColor":"#ffffff"}}'token='STRINGCONTAININGAUTHORIZATIONTOKEN'R

ruby - 仅使用必需的提供程序构建 Fog gem 并限制依赖项

我正在使用出色的Foggem来访问Rackspace云文件服务。我面临的挑战是,我正在努力使访问CloudFiles的服务保持轻量级,而且Fog似乎通过其灵active具有很多我永远不需要的依赖项和代码。有没有人尝试过构建Fog的精简副本,只包含一部分提供者,从而限制依赖性?例如,专门针对Rackspace云文件API,我希望能够在没有net-ssh、net-scp、nokogirigems以及亚马逊、Rackspace和其他20个未使用的提供商的所有未使用代码的情况下处理所有内容用过的。我希望避免在每次这些未使用的提供程序之一发现错误时升级gem,同时减少我的内存占用。如果任何人在这

ruby-on-rails - `rbenv install 2.2.0` 错误

尝试SetupRubyOnRailsonUbuntu14.04TrustyTahr控制台错误输出:rbenvinstall2.2.0Downloadingruby-2.2.0.tar.gz...->http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fcInstallingruby-2.2.0...BUILDFAILED(Ubuntu14.04usingruby-build20150112)Inspectorcleanuptheworkingt

ruby - 通过 gem install mechanize 安装 gems 时显示错误 "invalid switch in RUBYOPT: -F (RuntimeError)"

我尝试通过以下命令在我的计算机上安装gem(Mechanize):>>geminstallmechanize--platform=ruby>>geminstallmechanize错误ERROR:Errorinstallingmechanize:ERROR:Failedtobuildgemnativeextension."C:/ProgramFiles/Ruby200-x64/bin/ruby.exe"extconf.rbC:/ProgramFiles/Ruby200-x64/bin/ruby.exe:invalidswitchinRUBYOPT:-F(RuntimeError)在我尝

ruby-on-rails - 将 Timecop gem 用于范围

我在Rails3.0应用程序中指定一个范围,如下所示:classDrawingList=?',Date.today,Date.today)end在我的规范中,我想做的是:beforedo@list=DrawingList.create#thingsthatincludebeginandenddatesendit"doesn'tfindanactivedrawingiftheyareoutofrange"dopending"reallyneedtofigureouthowtoworktimecopinthepresenceofscopes"Timecop.travel(2.days)pu

ruby-on-rails - 找不到有效的 gem : certificate verify failed

我正在尝试建立到远程服务器的ssh隧道,如下所述:SSHfromHerokuintoremoteserverwithMysqlDb但是我只是想下载gems就挂断了。我补充说:#file:Gemfile...gem'net-ssh-gateway','~>1.2.0'但是当我执行bundleinstall(或者甚至只是在命令行上执行geminstallnet-ssh)时,我得到:ERROR:Couldnotfindavalidgem'net-ssh'(>=0),hereiswhy:Unabletodownloaddatafromhttps://rubygems.org/-SSL_conn

ruby - 在 IRB 中使用 ice_cube Ruby gem

我正在尝试使用名为ice_cube的Rubygem在IRB中,但它不起作用:[~]$rvmgemsetcreateice'ice'gemsetcreated(/home/joe/.rvm/gems/ruby-1.9.2-p320@ice).[~]$rvmgemsetuseiceUsingruby-1.9.2-p320withgemsetice[~]$geminstallice_cubeFetching:ice_cube-0.8.0.gem(100%)Successfullyinstalledice_cube-0.8.01geminstalledInstallingridocumenta

ruby - 如何使用 Whenever gem 强制 rake 任务在开发环境下运行

我正在使用Whenevergem运行rake任务。当我运行rake任务时,它在开发环境下运行,但当它在预定时间运行时,它指的是生产环境。如何强制在开发环境下运行预定的rake任务。据我所知,我将不得不使用RAILS_ENV变量,但无法弄清楚将它放在哪里。我认为,这与此处的Whenevergem无关。 最佳答案 在任何bash类型的shell中,您通常可以在运行时覆盖环境:RAILS_ENV=developmentraketask:name...您也可以编写一个小脚本来为您执行此操作:#!/bin/shexportRAILS_ENV=

ruby - 使用 Rest Client Ruby Gem 的身份验证 header

我已经创建了一个基本的身份验证key,现在我只是想使用它。我尝试了几种不同的变体,但似乎都没有在请求header中显示授权。$auth='BasiccmFtZXNoQHVzYW1hLmNvbTpyYW1lc2h1JEBtcA=='@response=resource.post('Authorization'=>$auth)nor@response=resource.post(:authorization=>$auth)nor@response=resource.post(:Authorization=>$auth)nor@response=resource.post(:content_