According to https://lists.gnu.org/archive/html/emacs-orgmode/2015-11/msg00425.html ob-sh was renamed ob-shell in org 8.2 ... and I cite from there:
org-babel-get-header was removed in 0d000f5 (babel: small change in
API., 2015-10-29), but the old ob-sh.el is still trying to call it.
That means you should replace (sh . t) by (shell . t) in your call of ...
You can find out how your code is executed by checking ob-shell.el. As for your particular example, your code is passed to bash as stdin, something like the following
$ echo 'echo $VAR_DEFINED_IN_BASHRC' | bash
It will not work, you need the following instead
$ echo 'echo $VAR_DEFINED_IN_BASHRC' | bash -i
So you need to run bash interactively (-i) to ...
The function org-babel-expand-noweb-referenes will expand the <<noweb>> entries. You can call this function from another source block (use a :wrap header argument to make source the output is wrapped in an appropriate source block):
#+BEGIN_SRC elisp :exports none
Only if you use the header argument :results value the code of the block is wrapped by a function and the result of the code block is the return value of that function.
#+BEGIN_SRC python :exports both :results value
return 7 + 7
On the other hand :results output means that the code of the block is sent to the interpreter. The result of the code ...
There are multiple issues going on, which I will do my best to address in a language agnostic manner.
Short Generic Answer
Use org-babel-expand-src-block1 to preview code that will be executed in the temporary file.
Place cursor, i.e. the point, inside the code block on on the #+BEGIN_SRC line.
Press C-c C-v v to open new Org-Babel Preview buffer.
There are two options you could use, but I imagine that none are exactly what you want:
1) Create derived classes from the template classes
#+begin_src ruby :tangle ./app/models/appuser.rb
class AppUser < User
Braintree.api_key = "bk-54cfa45"
self.id = Braintree::...
By pass in target directory as path into Clojure code, and use java.io.File.renameTo to move generate plot image file to target dir.
Here is the complete story background: https://stardiviner.github.io/Blog/Clojure-Plotting-to-Org-inline-image-in-ob-clojure.html
Here is a complete example:
#+begin_src clojure :results file link :dir "data/images" :file "...