New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run Biostars out of the box: "lessc: command not found" #193

Closed
rchikhi opened this Issue Jul 24, 2013 · 5 comments

Comments

Projects
None yet
2 participants
@rchikhi
Copy link

rchikhi commented Jul 24, 2013

This is a clean install of Biostars (./biostars.sh init import run).
The server runs fine but serves an error instead of the main page. I do not have Node.js nor Less pre-installed on this server.

FilterError at /

/bin/sh: lessc: command not found

Request Method:     GET
Request URL:    http://[edited]
Django Version:     1.4
Exception Type:     FilterError
Exception Value:    

/bin/sh: lessc: command not found

Exception Location:     /[edited]/biostar-central/libs/compressor/filters/base.py in input, line 133
Python Executable:  /usr/bin/python
Python Version:     2.6.6
Python Path:    

['/[edited]/biostar-central',
 '/[edited]/biostar-central'/biostar-central',
 '/[edited]/biostar-central/main',
 '/[edited]/biostar-central/libs',
 '/[edited]/biostar-central/libs/libraries.zip',
 '/usr/lib64/python26.zip',
 '/usr/lib64/python2.6',
 '/usr/lib64/python2.6/plat-linux2',
 '/usr/lib64/python2.6/lib-tk',
 '/usr/lib64/python2.6/lib-old',
 '/usr/lib64/python2.6/lib-dynload',
 '/usr/lib64/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages',
 '/[edited]/biostar-central/libs',
 '/[edited]/biostar-central/libs/libraries.zip']
@ialbert

This comment has been minimized.

Copy link
Owner

ialbert commented Jul 25, 2013

looks like the precompiler gets triggered once you turn debug off. If the lessc is not installed one needs to disable the django_compressor: http://django-compressor.readthedocs.org/en/latest/settings/

Add the following to your settings file:

COMPRESS_ENABLED=False
COMPRESS_PRECOMPILERS=[]

does that solve the problem?

@rchikhi

This comment has been minimized.

Copy link
Author

rchikhi commented Jul 25, 2013

Yes!
Adding these two lines to conf/default.env didn't work, but adding them to main/settings.py did the trick.

Thanks for the quick response.

@rchikhi rchikhi closed this Jul 25, 2013

@rchikhi

This comment has been minimized.

Copy link
Author

rchikhi commented Jul 31, 2013

I have to retract my previous comment (Other issues prevented me from knowing that this issue was not fully resolved).
The proposed fix solved the "lessc: command not found" issue. But now the css is served uncompiled, the main page looks for:
/static/biostar.less
instead of:
/static/biostar.less.css, which does not even exist.

So, how can I compile the .less files without having lessc?

@rchikhi rchikhi reopened this Jul 31, 2013

@ialbert

This comment has been minimized.

Copy link
Owner

ialbert commented Jul 31, 2013

The way to compile less is to include the on-the-fly precompiler, less.js in the page.

The relevant line is located here:

https://github.com/ialbert/biostar-central/blob/master/main/server/templates/base.html#L30

when the template is debug mode the CSS is passed via the compile-on-the fly mode.

You could just replace the word 'debug' there with 1, making the first path active all the time.

I will look into adding a new variable that one would need to be explicitly set for the compression to take place rather than relying on solely the value of debug since that is used for many other purposes.

@rchikhi rchikhi closed this Aug 1, 2013

@rchikhi

This comment has been minimized.

Copy link
Author

rchikhi commented Aug 1, 2013

Thanks, that worked!

I also explored another direction that also solved the problem:

pip install nodeenv
nodeenv nodeenv
source nodeenv/bin/activate
npm install -g less

That installed lessc. Just need to source nodeenv each time before running Biostar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment