Hi Jesse,
In the past I have never been able to compile the app in dev, though on the
production server it was fine. Now I realise this was almost certainly tied
up with the naming conventions. I run 4 instances on the production server,
but in each case the app name is reflected in the name of the directory.
Previously trying to compile in dev gave an error in init. This time we
seem to have moved a little further through the process because it took a
little longer and gave the following:
graeme@graeme-IdeaPad-S410p:~/projects/egolf/dev/prodfix$ ./rebar boss
c=compile==> prodfix (boss)
07:52:03.419 [info] Application lager started on node nonode@nohost
ERROR: boss failed while processing
/home/graeme/projects/egolf/dev/prodfix: {'EXIT',
{undef,
[{rebar_config,get_global,
[{config,"/home/graeme/projects/egolf/dev/prodfix",
[{plugin_dir,["priv/rebar"]},
{plugins,[boss_plugin]},
{eunit_compile_opts,[{src_dirs,["src/test"]}]},
{edoc_opts,[no_packages,private]},
local]},
verbose,0],
[]},
{boss_rebar,compile,4,
[{file,"../ChicagoBoss-0.8.12/priv/rebar/boss_rebar.erl"},
{line,100}]},
{boss_plugin,boss,2,[{file,"priv/rebar/boss_plugin.erl"},{line,33}]},
{rebar_core,run_modules,4,[]},
{rebar_core,execute,4,[]},
{rebar_core,process_dir0,6,[]},
{rebar_core,process_commands,2,[]},
{rebar,main,1,[]}]}}
graeme@graeme-IdeaPad-S410p:~/projects/egolf/dev/prodfix$
The application section of my boss.config file looks ike this:
{egolf, [
{path,"../prodfix"},
{base_url, "/"}
]}
so I should be able to pick up my path through
AppDir = boss_env:get_env(App, path, ""),
as in the change i suggested, yes?
Thanks for your help,
g
On 4 July 2014 06:35, Jesse Gumm <[email protected]> wrote:
> 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.
>
--
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/CAKF5fiB10rEiBGxwVC13_cKumn7PRkbKGVknTODGEiz3hDWhQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.