Chef infra chef文件缓存不在预期位置

Chef infra chef文件缓存不在预期位置,chef-infra,chef-recipe,test-kitchen,Chef Infra,Chef Recipe,Test Kitchen,尝试以下关于厨师学习的示例时: 我遇到了一个关于这段代码的问题 # Create a path to the SQL file in the Chef cache. create_tables_script_path = File.join(Chef::Config[:file_cache_path], 'create-tables.sql') 文件未显示在指定的位置: STDOUT: STDERR: sh: /tmp/create-tables.sql: No such fi

尝试以下关于厨师学习的示例时:

我遇到了一个关于这段代码的问题

# Create a path to the SQL file in the Chef cache.
create_tables_script_path = File.join(Chef::Config[:file_cache_path], 'create-tables.sql')
文件未显示在指定的位置:

STDOUT:
       STDERR: sh: /tmp/create-tables.sql: No such file or directory
       ---- End output of mysql -h 127.0.0.1 -u db_admin -pdatabase_password -D my_company < /tmp/create-tables.sql ----

有什么好主意吗?

我最后编辑了chef learning示例中下面的执行代码块,指向(我猜是新的默认)位置:

# Seed the database with a table and test data.
execute 'initialize my_company database' do
  command "mysql -h 127.0.0.1 -u db_admin -p I_luv_flapjacks -D my_company < /tmp/kitchen/cache/create-tables.sql"
  not_if  "mysql -h 127.0.0.1 -u db_admin -p I_luv_flapjacks -D my_company -e 'describe customers;'"
end
#使用表和测试数据为数据库种子。
执行“初始化我的公司数据库”执行
命令“mysql-h 127.0.0.1-u db_admin-pi_luv_flapjacks-D my_company
# Seed the database with a table and test data.
execute 'initialize my_company database' do
  command "mysql -h 127.0.0.1 -u db_admin -p I_luv_flapjacks -D my_company < /tmp/kitchen/cache/create-tables.sql"
  not_if  "mysql -h 127.0.0.1 -u db_admin -p I_luv_flapjacks -D my_company -e 'describe customers;'"
end