Trying to get started, getting OSError

53 views
Skip to first unread message

Branko Vukelic

unread,
Dec 6, 2012, 4:05:42 PM12/6/12
to django-...@googlegroups.com
I have deployed a Django app on a VPS. I have more or less identical setup on VPS as on my development box, both running ArchLinux, and Node.js 0.8.x. node is 0.8.15 on dev box, and 0.8.8 on VPS. Both boxes have uglifyjs installed (and r.js, if that matters).

The django-require 1.0.1 is configured as per the documentation with following settings:

    # RequireJS configuration
    STATICFILES_STORAGE = 'require.storage.OptimizedCachedStaticFilesStorage'
    REQUIRE_BUILD_PROFILE = 'app.build.js'
    REQUIRE_ENVIRONMENT = 'node'

The static root differs between deployed code and the dev code. Dev code places static root in PROJECT_DIR/PROJECT_PACKGE/static whereas the deployed code puts statics in /srv/http/PROJECT/static.

I have most of my app-specific statics in PROJECT_DIR/static. Some static files are pulled in from pluggable app.

Now, if I don't use the optimized static storage, collectstatic works fine. If I use optimized storage, it works on dev box, but fails on VPS with:

    OSError: [Errno 2] No such file or directory

So far I haven't been able to figure out where this error comes from.

Where should I look to determine where this error comes from and how do I get rid of it?

Thanks,


Branko

Branko Vukelic

unread,
Dec 6, 2012, 4:19:16 PM12/6/12
to django-...@googlegroups.com
Scratch this (and sorry). The VPS version of the code did not actually use 1.0.1 but was still using 1.0.0.

TAH

unread,
Dec 6, 2012, 5:43:30 PM12/6/12
to django-...@googlegroups.com
I just solved this problem myself.  For me the issue was with:

REQUIRE_ENVIRONMENT = "node"

I didn't have node installed, so it couldn't find it to run. 

Terrible, confusing error message.

T.

TAH

unread,
Dec 6, 2012, 5:48:15 PM12/6/12
to django-...@googlegroups.com
Just re-read your message.  I see that you do have no installed on your box.  Is it in the path?

If nothing else, at least learn from my experience that this error message seems to unhelpfully lump together both problems with the executable as well as with the paths passed to it.

T.

Branko Vukelic

unread,
Dec 6, 2012, 5:53:20 PM12/6/12
to TAH, django-...@googlegroups.com
On Thu, Dec 6, 2012 at 11:48 PM, TAH <the...@gmail.com> wrote:
> Just re-read your message. I see that you do have no installed on your box.
> Is it in the path?

I solved the issue. Just forgot to add the ``--update`` flag to pip
when I was reinstalling dependencies so django-require on VPS was
still 1.0.0. After updating to 1.0.1, it works.

--
Branko

bra...@brankovukelic.com

IDEA MACHINE (blog)
brankovukelic.com

Dave Hall

unread,
Dec 7, 2012, 4:39:32 AM12/7/12
to Branko Vukelic, TAH, django-...@googlegroups.com
Hello all,

Argh! Sorry for the aggro! Yeah, there could be a better error message here.
With the new node environment support, there is code in the tests.py file for detecting which environments are available, so this can be moved to a helpers.py file and used to give nicer error messages.

This should all be fixed us when issue #10 is completed.

In general, the error messages with the r.js script are themselves a little annoyingly bizarre at times. I tend to overlook this, however, since the tool itself is so otherwise awesome.



--



Reply all
Reply to author
Forward
0 new messages