【问题标题】:Why is my thor copy_file command not working?为什么我的 thor copy_file 命令不起作用?
【发布时间】:2013-01-22 18:25:06
【问题描述】:

我正在尝试设置一个 Rails 应用程序模板并将此代码放在我的 sample.rb 模板文件中:

run "bundle install"

copy_file "/Users/amiterandole/Desktop/current/rails/templates/guard/Guardfile", "."

捆绑安装运行正常,但复制命令失败并出现以下错误:

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/thor-0.16.0/lib/thor/actions/create_file.rb:47:in `binread': Is a directory - /Users/amiterandole/Desktop/current/rails/templates/myapp (Errno::EISDIR)

我无法理解这个错误以及如何解决它。我究竟做错了什么?请帮忙。

【问题讨论】:

  • 请展示你的雷神配置
  • @Lichtamberg 我实际上没有这些。这些到底是什么?你能指点我的文档吗?我正在使用独立的 ruby​​ 文件

标签: ruby-on-rails templates thor


【解决方案1】:

尝试指定包含文件名的目标文件路径。

copy_file "/Users/amiterandole/Desktop/current/rails/templates/guard/Guardfile", "my_destination_path/Guardfile"

【讨论】:

    猜你喜欢
    • 2015-04-29
    • 1970-01-01
    • 2020-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-23
    相关资源
    最近更新 更多