问题 How can I write this command in chef ? /home/vagrant$ source ~/.rvm/scripts/rvm (->enter) I tried... execute "foo" do command "source ~/.rvm/scripts/rvm" action :run end in short, how can I write a simple command in chef? not installing something. thanks!!! 回答1: This isn't something Chef supports. source is a shell builtin, not a command, and it would have no effect on Ruby anyway has that isn't a Ruby script, it is a shell script. You can use a bash resource like this: bash 'do the needful'