Hi Graeme,

As you've noted, you're definitely getting burned by the fact that
your app and its containing directory aren't the same.

Give this a shot:

./rebar boss c=compile

Then run init and see if your change works.

What is your current path set to in boss.config (for your app, not for 'boss')?

On Thu, Jul 3, 2014 at 5:30 AM, Graeme Defty <[email protected]> wrote:
> Got it! Well . . . at least I have found the offending (to me) code and
> found a (partial) fix.
>
> In boss_web_controller_handle_request:build_static_response/4 there is a
> call to make_etag/3. This function looks like this:
>
> make_etag(App, StaticPrefix, File) ->
>     Priv = case code:priv_dir(App) of
>         {error, bad_name} ->
>             %% enuit isn't loading the application, so this will default for
> us
>             "../priv";
>         P ->
>             P
>     end,
>    --- etc ---
>
> That double '.' on the 5th line is what is causing my problems. If I delete
> on of those '.'s everything works fine.
>
> So why did nobody else suffer from this problem?
>
> The code at that point seems to be handling cases where the application's
> priv_dir is not being found. I am guessing I am the only one in this
> situation whereas nobody else is.
>
> And why is that? I think it comes back to the issue of the application and
> the directory not being named the same. If I go to the command line and type
>
> code:priv_dir(app_name).
>
> I do indeed get the response {error, bad_name}.
>
> However if I type:
>
> code:priv_dir(dir_name).
>
> the response is the correct path to my priv dir.
>
> SOOooooooooooo . . .
>
> I think that the code should read:
>
> make_etag(App, StaticPrefix, File) ->
>     AppDir = boss_env:get_env(App, path, ""),
>     Priv = case code:priv_dir(AppDir) of
>         {error, bad_name} ->
>             %% enuit isn't loading the application, so this will default for
> us
>             "./priv";
>         P ->
>             P
>     end,
>
>
> HOWEVER, this does not work because boss_env:get_env does not return the
> correct value for path. It returns 'undefined'.
>
> I have checked my boss.config and it looks fine.
>
> Is there a problem with boss setting up the attributes in the boss.config
> file as attributes of my application?
>
> Thanks  (and sorry for rambling on a bit)
>
> g
>
>
>
>
>
>
>
>
> On 3 July 2014 12:33, Graeme Defty <[email protected]> wrote:
>>
>> OK - so you live and learn . . . multiple '/' characters in a path are
>> fine - the extra ones are just ignored, so I have replaced all my leading
>> slashes.
>>
>> But why then are my files not found?
>>
>> It appears to be the '../priv/' at the front of the path is taking me one
>> level too high. It is the priv directory which is not being found.
>>
>> I created a link in the directory ABOVE my application directory, called
>> it priv and pointed it to the priv directory within the application and all
>> was well.
>>
>> SOOOooooo - looks like the '../priv/' added to the beginning of the path
>> should have been './priv/'.
>>
>> BUT - why am I the only one having this issue? It seems pretty
>> fundamental. Clearly I have something else set up incorrectly.
>>
>> Any ideas, anyone?
>>
>> g
>>
>>
>>
>> On 1 July 2014 21:28, Graeme Defty <[email protected]> wrote:
>>>
>>> Well maybe just 1 more error . . .
>>>
>>> previously my links such as "/static/blah/blah" would access static files
>>> <<app>>/prov/static/blah/blah"
>>>
>>> Now I get errors accessing file <<app>/priv//static/blah/blah"  (note the
>>> double "/")
>>>
>>> However, if I take off the leading "/" from the link, I get reports of
>>> "unknown action 'static'" on whatever controller I happen to be on.
>>>
>>> Any suggestions?
>>>
>>> g
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "ChicagoBoss" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to [email protected].
>>> Visit this group at http://groups.google.com/group/chicagoboss.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/chicagoboss/CAKF5fiB0086_jmnCj3bz4wqs7mWJmWj4dROHUjAgT%2B9OFUopdQ%40mail.gmail.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ChicagoBoss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> Visit this group at http://groups.google.com/group/chicagoboss.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/chicagoboss/CAKF5fiBdAJojy9%2B%3D980Hj%3DnEzyc0s2D7z8YAVgZ-V%2BVcfRp3ew%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

-- 
You received this message because you are subscribed to the Google Groups 
"ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/chicagoboss/CAPTXyXdLn1sLO4%3DQ%3Dr-%3DY5U%2BtO0J42yw4%3Du_YSPmjNCQ_ASomA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to