title: local luarocks package install (luarepl) does not work
body: <p>I'm new to luarocks and I just tried to install luarepl.
  The installation apparently went fine:</p>
  
  <pre><code>$ luarocks install luarepl
  Installing https://luarocks.org/luarepl-0.8-1.rockspec...
  Using https://luarocks.org/luarepl-0.8-1.rockspec... switching to 'build' mode
  Updating manifest for /Users/me/.luarocks/lib/luarocks/rocks-5.1
  luarepl 0.8-1 is now built and installed in /Users/me/.luarocks (license: MIT/X11)
  </code></pre>
  
  <p>but if I try to launch the executable, it seems that the installation is broken:</p>
  
  <pre><code>$ ~/.luarocks/bin/rep.lua
  /usr/local/bin/lua5.1: ...cks/lib/luarocks/rocks-5.1/luarepl/0.8-1/bin/rep.lua:23: module 'repl.console' not found:
      no field package.preload['repl.console']
      no file './repl/console.lua'
      no file '/usr/local/share/lua/5.1/repl/console.lua'
      no file '/usr/local/share/lua/5.1/repl/console/init.lua'
      no file '/usr/local/lib/lua/5.1/repl/console.lua'
      no file '/usr/local/lib/lua/5.1/repl/console/init.lua'
      no file './repl/console.so'
      no file '/usr/local/lib/lua/5.1/repl/console.so'
      no file '/usr/local/lib/lua/5.1/loadall.so'
      no file './repl.so'
      no file '/usr/local/lib/lua/5.1/repl.so'
      no file '/usr/local/lib/lua/5.1/loadall.so'
  stack traceback:
      [C]: in function 'require'
      ...cks/lib/luarocks/rocks-5.1/luarepl/0.8-1/bin/rep.lua:23: in main chunk
      [C]: ?
  </code></pre>
  
  <p>I look into the ~/.luarocks dir:</p>
  
  <pre><code>$ cd ~ ; find .luarocks
  .luarocks
  .luarocks/bin
  .luarocks/bin/rep.lua
  .luarocks/config.lua
  .luarocks/lib
  .luarocks/lib/luarocks
  .luarocks/lib/luarocks/rocks-5.1
  .luarocks/lib/luarocks/rocks-5.1/luarepl
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/bin
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/bin/rep.lua
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc/COPYING
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc/IDEAS.md
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc/plugins.md
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc/README.md
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/doc/Roadmap.md
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/luarepl-0.8-1.rockspec
  .luarocks/lib/luarocks/rocks-5.1/luarepl/0.8-1/rock_manifest
  .luarocks/lib/luarocks/rocks-5.1/manifest
  .luarocks/share
  .luarocks/share/lua
  .luarocks/share/lua/5.1
  .luarocks/share/lua/5.1/repl
  .luarocks/share/lua/5.1/repl/console.lua
  .luarocks/share/lua/5.1/repl/init.lua
  .luarocks/share/lua/5.1/repl/plugins
  .luarocks/share/lua/5.1/repl/plugins/autoreturn.lua
  .luarocks/share/lua/5.1/repl/plugins/completion.lua
  .luarocks/share/lua/5.1/repl/plugins/example.lua
  .luarocks/share/lua/5.1/repl/plugins/filename_completion.lua
  .luarocks/share/lua/5.1/repl/plugins/history.lua
  .luarocks/share/lua/5.1/repl/plugins/keep_last_eval.lua
  .luarocks/share/lua/5.1/repl/plugins/linenoise.lua
  .luarocks/share/lua/5.1/repl/plugins/pretty_print.lua
  .luarocks/share/lua/5.1/repl/plugins/rcfile.lua
  .luarocks/share/lua/5.1/repl/plugins/rlwrap.lua
  .luarocks/share/lua/5.1/repl/plugins/semicolon_suppress_output.lua
  .luarocks/share/lua/5.1/repl/sync.lua
  .luarocks/share/lua/5.1/repl/utils.lua
  </code></pre>
  
  <p>and I can find that stuff.
  I tried adding a line to config.lua to load packages from local installation to no avail:</p>
  
  <pre><code>$ cat ~/.luarocks/config.lua
  local_by_default=true
  </code></pre>
  
  <p>(removing it has no effect)</p>
  
  <p>did I miss some obvious step?</p>
  
  <p>running <code>luarocks</code> with no arguments gives me:</p>
  
  <pre><code>CONFIGURATION
      Lua version: 5.1
      Configuration files:
          System: /usr/local/etc/luarocks51/config-5.1.lua (ok)
          User  : /Users/me/.luarocks/config.lua (ok)
  
      Rocks trees in use:
          /Users/me/.luarocks ("user")
          /usr/local ("system")
  </code></pre>
  
  <p>it seems that the user rock tree is not in the package path:</p>
  
  <pre><code>$ lua
  Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
  &gt; print(package.path)
  ./?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/lib/lua/5.1/?.lua;/usr/local/lib/lua/5.1/?/init.lua
  </code></pre>
  
  <p>why?</p>