草庐IT

kali-installer-images

全部标签

ruby-on-rails - 无法运行 `bundle install`

所以前几天我遇到了严重的硬盘问题,不得不手动删除我的.gem文件夹。我试图通过进入我的项目文件夹运行bundleinstall来为我的应用程序重建gem...不幸的是我遇到了这个错误:/home/xxx/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in`require':cannotloadsuchfile--bundler(LoadError)from/home/xxx/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2

ruby-on-rails - rvm 安装 : ruby installation error

我想在我的LinuxMint12上安装ruby​​。我正在关注thistutorial和thisone.当我运行rvminstall1.9.3时,我看到了这个错误:InstallingRubyfromsourceto:/usr/share/ruby-rvm/rubies/ruby-1.9.3,thismaytakeawhiledependingonyourcpu(s)...ruby-1.9.3-#fetchingruby-1.9.3-#extractingruby-1.9.3-to/usr/share/ruby-rvm/src/ruby-1.9.3ERROR:Errorrunning'

ruby-on-rails - 回形针 :style depending on model (has_many polymorphic images)

我已将我的模型设置为使用多态图像模型。这工作正常,但我想知道是否可以更改每个模型的:styles设置。找到了一些使用STI(Model艺术has_many:images,:as=>:imageable图片belongs_to:imageable,:polymorphic=>truehas_attached_file:file,:styles=>{:thumb=>"150x150>",:normal=>"492x600>"}#Changethissettingdependingonmodel更新我尝试在Proc方法中启动调试器。仅填充与附件相关的字段:run'irb(Image):006

ruby - bundle install 为 #<Bundler::Dsl:0x00000001c4e1f8> 提供未定义的方法 `ruby'

bundleinstall给出:>undefinedmethod`ruby'for#知道如何解决吗?我使用的是Ruby1.9.3-p125。 最佳答案 Gembundler的1.2版介绍了一个rubymethodtothedsl允许您指定您的应用程序应使用的Ruby版本。看起来您使用的Gemfile是为这个新版本编写的,但是您的bundler版本不支持ruby方法。您需要安装最新的bundler(geminstallbundler应该这样做)或从您的Gemfile中删除该行。 关于rub

ruby-on-rails - Rails 如何使用 image_tag 列出文件夹中的所有图像?

我正在尝试获取“app/assets/images/slide”文件夹中的所有图像并将它们放入标签(按顺序)。所以,它看起来像这样:我怎样才能做到这一点?(我使用的是Rails3.2.9)这是我试过的代码(感谢Khaled)。但它输出所有图像路径的纯文本列表。我需要显示图像:@images=Dir.glob("app/assets/images/slide/*.jpg")@images.eachdo|image|image_tagimage.gsub("app/assets/images/","")end 最佳答案 在您的Contr

ruby-on-rails - Rails 安装错误 :The 'atomic' native gem requires installed build tools

这个问题在这里已经有了答案:The'json'nativegemrequiresinstalledbuildtools(8个答案)关闭7年前。我正在我的Windows上安装Rails3。我安装了最新的ruby​​2.0.0,并更新了gems。但是当我使用geminstallrails安装rails时,出现了成功的消息,但最后我找到了ERROR:Errorinstallingrails:The'atomic'nativegemrequiresinstalledbuildtoolsPleaseupdateyourPATHtoincludebuildtoolsordownloadtheDev

ruby - 迷你魔术 : Cut circle out of square image

我需要用MiniMagick将方形图像转换为圆形图像.我知道有一个way使用ImageMagick:convert-size300x300xc:transparent-fill"image.png"-draw"circle240,90290,90"-crop100x100+190+40+repagecircle1.png我试过翻译:img.combine_optionsdo|c|c.draw"circle240,90290,90"c.crop"100x100+190+40"c.repage.+end我得到了这个东西,一个以我的大Nose为背景的黑色圆圈:如果有人知道如何正确翻译这个..

ruby - 法拉第 : you may want to install system_timer for reliable timeouts

我将一个旧脚本迁移到一个新的CentOSbox并在运行脚本时收到以下消息:Faraday:youmaywanttoinstallsystem_timerforreliabletimeouts它是警告吗?system_timer是什么?gem? 最佳答案 这是一颗gem。不过,您应该不再需要它了,因为它只支持Ruby1.8及更早版本(Ruby1.8已正式弃用)。来自http://ph7spot.com/musings/system-timer:Update:system_timerisonlyrelevantifyouarerunni

ruby-on-rails - 对于 Ruby, "gem install"是否使用 "--include-dependencies"...只是文档有点过时了?

使用RubyonRails,如果我做一个gemhelpinstall它的一部分说:-y,--include-dependenciesUnconditionallyinstalltherequireddependentgems[...]Defaults:--both--version'>=0'--rdoc--ri--no-force--no-test--install-dirc:/ruby/lib/ruby/gems/1.8但是如果我做一个geminstall--include-dependenciesmysql一行说:INFO:`geminstall-y`isnowdefaultand

ruby - "Pow is installed"现在出现在我所有的网站上

我为我正在开发的Rails应用安装了带有RVM的Pow。没关系。其他网站现在都说“已安装Pow”。我确定这是一个简单的设置,但我找不到它。有人遇到过这个吗?我在SnowLeopard上运行MAMP。 最佳答案 Pow将更改您的DNS解析,将所有以.dev或.test结尾的域路由到本地计算机(以命中pow)。如果您想同时使用MAMP和POW,您需要暂时关闭pow以便它可用(或者您可以使用80以外的其他端口更改MAMP设置)。要关闭pow,我建议安装powdergem:geminstallpowderpowderdown您还可以使用po