gpt4 book ai didi

ruby-on-rails - Rails rake 'Don' t 知道如何构建任务'

转载 作者:行者123 更新时间:2023-12-04 05:59:13 25 4
gpt4 key购买 nike

我正在尝试使用多个参数在终端中运行我的 rake 任务,但是我不断收到错误消息:

rake populate:user['a' 'a'] 
DL is deprecated, please use Fiddle
rake aborted!
Don't know how to build task 'populate:user[a'

我的 rake 文件:

namespace :populate do
desc 'Populate data into our database'

task :user, [:username, :password] => :environment do |t, args|
// do stuff, also doesn't work when I delete everything inside here
end
end

我也试过

rake populate:user[a, a] 

它确实在没有任何参数的情况下运行:

rake populate:user

最佳答案

你可以试试

rake 'populate:user[a,a]'

您也可以引用 https://cobwwweb.com/4-ways-to-pass-arguments-to-a-rake-task

关于ruby-on-rails - Rails rake 'Don' t 知道如何构建任务',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30552769/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com