草庐IT

pipe_cmd_out

全部标签

ruby-on-rails - 安装 active admin 时 activeadmin.git (at master) is not yet checked out 错误

Activeadmingem已添加到我的rails项目中,但每次我尝试安装railsgactive_admin:install时,我都会收到类似的错误git://github.com/activeadmin/activeadmin.git(atmaster)isnotyetcheckedout.Runbundleinstallfirst.我肯定在运行“railsgactive_admin:install”之前运行了bundle。运行“bundleshow”后,我看到我已将“*activeadmin(1.0.0.pre3f916d6)”添加到我的项目中,但不断收到此错误消息。我的gem文

ruby-on-rails - 在 Rails 中,我从 Guard 那里收到这个错误,说我必须更新到新的 :cmd syntax

我刚刚更新了我的gem,当我尝试运行Guard时,出现以下错误:Guard::RSpecDEPRECATIONWARNING:The:clioptionisdeprecated.Pleasecustomizethenew:cmdoptiontofityourneed.这是我的Guard文件:guard'rspec',cli:'--drb'dowatch(%r{^spec/.+_spec\.rb$})watch(%r{^lib/(.+)\.rb$}){|m|"spec/lib/#{m[1]}_spec.rb"}watch('spec/spec_helper.rb'){"spec"}#Ra

ruby - 当 shelled-out 命令返回非零退出代码时,如何让 Ruby 脚本失败?

在Ruby脚本中,有variousways调用系统命令/命令行反引号:`commandarg1arg2`分隔形式,例如%x(commandarg1arg2)(可用其他分隔符)Kernel#system方法:system('commandarg1arg2')Kernel#exec方法:exec('commandarg1arg2')如果我希望Ruby脚本在调用的命令失败时失败(有异常)(具有非零退出代码),我可以检查特殊变量中的退出代码$?对于前两个变体:`commandarg1arg2`failunless$?==0或%x,commandarg1arg2,failunless$?==0如

ruby - "shell out"或 "shelling out"是什么意思?

如在这些示例中使用的,例如:shellouttobundlefrominsideacommandinvokedbybundleexec或shellouttoaRubycommandthatisnotpartofyourcurrentbundle,http://bundler.io/man/bundle-exec.1.html或i'mshellingouttotheherokucommandintheraketaskhttps://github.com/sstephenson/rbenv/issues/400 最佳答案 这意味着使用反

已解决socket.timeout : The read operation timed out

已解决(pip安装模块超时,利用四种国内镜像源完美解决)WARENTING:Retrying(Retry(total=4,connect=None,read=None,redirect=None,status=None))afterconnectionbrokenby‘ConnectTimeoutError(pip._vendor.urllib3.connection.HTTPSConnectionobjectatOx00001D6OE4F4A940>,‘Connectiontopypi.orgtimedout.(connecttimeout=15)’)’':/simple/pip/socke

ruby-on-rails - 修改 Rails : How do advanced users find out what needs to be changed?

我已经使用Rails几个月了,我很乐意编写一个项目并根据我的需要操作Rails等。最近我一直在尝试更高级一些,所以我尝试修改/添加到现有的Rails代码库:添加新的表单辅助方法、添加responds_to:pdf方法等...然后我遇到了很多问题。困难在于学习我需要修改哪些代码;该代码所在的位置,以及如何确保我不会错过其他文件中的相关代码。我猜人们有办法学会这样做,但目前我主要只是猜测和希望。我想我的问题是,Rails人员如何了解他们需要修改的代码在哪里编辑以及编辑代码的方法?看起来这只是您需要先熟悉的东西,但我猜必须有一种简单的方法来理解在哪里(和什么)编辑。任何想法表示赞赏.....

ruby-on-rails - 找不到 id=sign_out 的用户

注销链接在我的Rails应用程序中不起作用。我检查了下面列出的routes.rb,我的application.html.erb看起来遵循正确的路径。出现以下错误。ActiveRecord::RecordNotFoundinUsersController#showCouldn'tfindUserwithid=sign_outRails.root:/Users/patrickwalsh/rails_projects/ytutorialApplicationTrace|FrameworkTrace|FullTraceapp/controllers/users_controller.rb:4:

ruby - 在 VIM 中执行代码类似于 Textmate 中的 Cmd+R 或 Cmd+B Sublime Text2

嘿,有没有办法或插件来执行代码,例如在我的例子中,Ruby直接来self的vim编辑器。我从Textmate了解到这一点,您可以在SublimeText2中使用Cmd+R或Cmd+B执行代码。在SublimeText中,它被称为BuildSystem。谢谢指教! 最佳答案 如果你只想在Ruby中执行当前缓冲区,你可以在正常模式下执行此操作::!ruby%您还可以使用您的领导键将其映射到快捷方式::mapr:!ruby%这会让您执行leader+r来运行文件。 关于ruby-在VIM中执行

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-on-rails - Ruby on Rails - 设计用户/sign_out 不工作

我正在使用设计sign_in和sign_up网址有效但是,当我尝试url时:http://localhost:3000/users/sign_out它产生路由错误Noroutematches[GET]"/users/sign_out"我该如何解决这个问题?rake路rakeroutesnew_user_sessionGET/users/sign_in(.:format){:action=>"new",:controller=>"devise/sessions"}user_sessionPOST/users/sign_in(.:format){:action=>"create",:con