Reputation: 23
I need to install plugin to CouchDB. The problem is that the only folder I can access on the server is user home directory. After I set ERL_LIBS env variable I can call my plugin module from erl console, but CouchDB returns '{"error":"unknown_error","reason":"undef"}'.
What is the right way to include external libraries on CouchDB start?
Upvotes: 2
Views: 771
Reputation: 16050
I managed to add an erlang module using the couchdb shell. Here is what I did:
sudo couchdb -i
code:add_patha("/home/akshat/Desktop").
code:get_path().
c("/home/akshat/Desktop/test").
code:load_file(test).
test:test()
To test if the module is loaded by couchdb automatically on start you can restart couchdb and call a function within the module without performing the steps above. It should work as expected.
This is the module I used for testing purposes
-module(test).
-export([test/0]).
test()->
hello.
I think the problem with what you did could be that you did not add the module using the couchdb shell.
Upvotes: 2