草庐IT

exec_SELECTgetRows

全部标签

deployment - 从不同的文件夹运行 ant exec 任务

我想在我的grails项目中运行我的“execgrails”任务。我在exec任务中设置了chalice路径,例如怎么说呢,那个exec应该从我的项目文件夹开始? 最佳答案 来自execAnttaskdocumentation:AttributeDescriptiondirthedirectoryinwhichthecommandshouldbeexecuted. 关于deployment-从不同的文件夹运行antexec任务,我们在StackOverflow上找到一个类似的问题:

ruby-on-rails - MySQL 问题 - RAILS_ENV=production bundle exec rake db :migrate

由于detailedmanual,我只是将redmine安装到我的服务器上.一切顺利,但最后一步因一些错误而失败,我不知道如何修复它。命令是RAILS_ENV=productionbundleexecrakedb:migrate输出错误Youcannotspecifythesamegemtwicewithdifferentversionrequirements.Youspecified:mysql(>=0)andmysql(~>2.9.1)gem列表***LOCALGEMS***actionmailer(3.2.15)actionpack(3.2.15)activemodel(3.2.

ruby-on-rails - 卡住安装 Rails : rails s and bundle exec rails server error

我使用的是Windows7、Ruby2.2.1和Rails4.2.0。运行railss或bundleexecrailsserver后出现以下错误:C:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri.rb:29:in`require':cannotloadsuchfile--nokogiri/nokogiri(LoadError)fromC:/Ruby22/lib/ruby/gems/2.2.0/gems/nokogiri-1.6.6.2-x86-mingw32/lib/nokogiri

ruby - 如何实时打印 exec() 的输出?

我在Ruby脚本中运行以下(备份)代码:fordirectoryindirectoriesprint`s3sync.rb--exclude="#{EXCLUDE_REGEXP}"--delete--progress-r#{directory}my.amazon.backup.bucket:#{directory}`end我希望执行的子进程的输出能够实时回显到终端(而不是必须等到子进程返回)。我该怎么做? 最佳答案 IO.popen创建一个进程并为该进程的stdin和stdout返回一个IO对象。IO.popen("s3sync.rb

ruby exec 使用我的 ~/.bashrc 中的函数

在我的~/.bashrc中,我有一个函数:functionsayHi(){echo"hi,$@"}在Ruby中我想:`sayHi"friend"`但是,sayHi在ruby​​运行exec或system的任何上下文中都“找不到”。如何让Ruby使用我的.bashrc中的函数? 最佳答案 您的.bashrc仅针对交互式shell运行。当您在Ruby中使用反引号执行命令时,它不会在交互式shell中执行该命令。您可以通过运行bash-i强制使用交互式shell。例如,要在交互式shell下运行命令,请使用:`bash-ic'sayHi"

ruby - 'bundle exec jekyll serve' 和 'jekyll serve' 有什么区别?

目前正在学习Jekyll,一个建站框架,不知道bundleexecjekyllserve和jekyllserve有什么区别。两者的行为似乎相同。 最佳答案 两个字:bundleexecjekyllserve-运行在您的Gemfile/Gemfile.lock中指定的确切jekyll服务器版本。jekyllserve-运行一些版本的jekyll服务器,它可能是也可能不是你想要的。为获得最佳结果,请始终使用bundleexec。在我的机器上,我有一个shell别名,这样我就可以输入bejekyllserve

ruby-on-rails - Rails exec_query 绑定(bind)被忽略

我正在尝试使用exec_query运行任意查询,其中的值是通过绑定(bind)引入的,但出现了意外错误。在控制台中运行sql='SELECT*FROMfoobarsWHEREidIN(?)'name='query_name_placeholder'binds=[FooBar.first]ActiveRecord::Base.connection.exec_querysql,name,binds产生这个错误:AccountLoad(7.9ms)SELECT"foobars".*FROM"foobars"ORDERBY"foobars"."id"ASCLIMIT1PG::SyntaxErr

ruby exec powershell 窗口

当我在ruby​​中运行以下命令时:`powershell.exe-executionpolicyunrestricted-commandget-module-listavailable`...我得到的结果与我只运行cmd并执行的结果不同:powershell.exe-executionpolicyunrestricted-commandget-module-listavailable我该如何解决这个问题,才能得到相同的结果? 最佳答案 是的。修复显然是sysnative别名。使用:C:/windows/sysnative/wind

ruby-on-rails - 使用 bundle exec 运行 Rails 控制台

当我执行bundleexecrailsc时,我得到一个带有以下提示的ruby​​控制台Loadingdevelopmentenvironment(Rails3.0.3)jruby-1.6.3:001>一切看起来都井井有条,但是当我使用↑↓箭头拉出我之前的命令时,我得到^[[A^[[B输出到我的控制台。在没有bundleexec的情况下运行railsconsole工作正常。这是为什么的任何原因?bundleexec是否启动了一些新的人造shell? 最佳答案 看起来bundler阻止了irb控制台使用readline。您可以通过在.i

ruby - rbenv exec bundle exec 而不仅仅是 bundle exec

我正在尝试设置rbenv:https://github.com/sstephenson/rbenv#section_2我有一个问题:我必须在一切之前使用rbenvexec所以现在我要做bundleexec:rbenvexec捆绑执行我该如何解决这个问题?编辑运行rbenvrehash后我得到:$➔rbenvrehash$➔railssbash:/usr/local/bin/rails:/usr/local/bin/ruby:badinterpreter:Nosuchfileordirectory 最佳答案 真的很傻:我忘记运行exe