rack - /c/Ruby30-x64/bin/rake:第 4 行:{#:找不到命令
问题描述
我目前正在使用 git bash 我尝试将 Rakefile 添加到我的存储库中。这是我在 Rakefile 中写的:
#!/usr/bin/ruby -wKU
task :default => :run
task :run do
require './lib/hello'
end
然后我做了这两个步骤:
git add Rakefile
git commit -m "Added a Rakefile."
然后,我使用 rake 命令运行我的 hello 程序。
这是我的 hello.rb 程序:
# Default is "World"
# Author: Jim Weirich (jim@somewhere.com)
name = ARGV.first || "World"```
puts "Hello, #{name}!"
当我运行 rake 命令时,我得到了这个:
/c/Ruby30-x64/bin/rake: line 4: {#: command not found
Hello, World!
为什么我在 hello world 上方出现错误?
提前致谢。
解决方案
推荐阅读
- gdi - 使用 pushlayer 和 poplayer 时,与 direct2d 兼容的 GDI 不起作用
- javascript - 尽管执行了 return false ,但仍会处理表单
- python - 在帖子下显示评论的聪明方法是什么?
- javascript - 异步函数完成后 Azure 函数不返回响应
- java - 有没有更好的方法来终止 iterator.forEachRemaining
- html - 如何更改默认引导程序必填字段样式
- swift - “标签”类型的值没有成员“lastUsed”
- r - 增加 R Shiny 中词云图的面积
- dart - Dart 事件循环控制等价物
- node.js - 将文件从 Angular 发送到 Node.js