Growing pains

80 views
Skip to first unread message

rex f

unread,
Jun 26, 2013, 2:08:58 PM6/26/13
to nitro...@googlegroups.com
Hello everyone! Thanks for the great community, and amazing resources. 

I am starting out, and my initial goal is to create a two view static website in Nitrogen, where the view transitions are triggered by the button click event. Long term goal is to develop a barebones API (hopefully within a year).

Currently, I am going through Rusty's tutorial (http://nitrogenproject.com/doc/tutorial.html), and I am at the part where I create my page with `bin/dev page myPage`

When I go to `$EDIT src/site/myPage.erl` I received a permission error that I ran `chmod 777 src/site/myPage.erl`

I run the above again, and get:
site/src/myPage.erl: line 1: fg: no job control
site/src/myPage.erl: line 2: syntax error near unexpected token `myPage'
site/src/myPage.erl: line 2: `-module (myPage).'

I go to localhost8080, and it's not recognized at all. Also localhost8000/myPage is not recognized either
Page not found: "/myPage"

I guess the critical point here is to properly run the `$EDIT src/site/myPage.erl` and your help would go a long way. Thank you!

Jesse Gumm

unread,
Jun 26, 2013, 2:52:37 PM6/26/13
to nitrogenweb
Hi Rex,

I think the issue you're encountering is simply that $EDIT is a placeholder for your editor of choice.

Are you actually running `$EDIT site/src/myPage.erl`?  If so, I recommend just typing emacs or vim in place of $EDIT, or use whatever editor you're comfortable with.

-Jesse



--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nitrogenweb...@googlegroups.com.
To post to this group, send email to nitro...@googlegroups.com.
Visit this group at http://groups.google.com/group/nitrogenweb.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



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

rex f

unread,
Jun 26, 2013, 3:09:24 PM6/26/13
to nitro...@googlegroups.com, gu...@sigma-star.com
Thank you Jesse!

Haha, I feel silly =/

That being the case though, I did access the file with my editor but could not access it on my browser. Especially using localhost:8080, it was completely unrecognized. 

For compilation, I did `bin/dev compile`, and afterwards in the console did `sync:go().`

By the way, `sync:go()` was running from before any modifications (adding page, to files) were made, and still no access to localhost/myPage

Was thinking I need another page, and added an element, then an action just for experimentation's sake, and still no go. Really appreciate the help already, thank you!

Jesse Gumm

unread,
Jun 26, 2013, 5:52:09 PM6/26/13
to rex f, nitrogenweb
Hi Rex,

To be sure, the default port is actually 8000, not 8080, so make sure you're hitting the right port.

Then, if that doesnt' solve it for you, the simple solution us to run `make` from the root of the generated Nitrogen directory. That will recompile everything that's necessary and straighten everything out (sometimes sync just doesn't do what you want).

If it's *still* not reading the new page, then I'd try just restarting the VM (I know, that's not the Erlang way, but perhaps sync isn't reading the directories right or something).

-Jesse

rex f

unread,
Jun 26, 2013, 6:56:33 PM6/26/13
to nitro...@googlegroups.com, rex f, gu...@sigma-star.com
Thanks Jesse! 

I have to give up for a while, or I might not make it to last. After running make, I can't run console anymore, and get this error:

Exec: /Users/rfatahi/nitrogen/rel/nitrogen/erts-5.9.3.1/bin/erlexec -boot /Users/rfatahi/nitrogen/rel/nitrogen/releases/2.1.0/nitrogen -embedded  -config /Users/rfatahi/nitrogen/rel/nitrogen/etc/app.config -config /Users/rfatahi/nitrogen/rel/nitrogen/etc/inets.config -args_file /Users/rfatahi/nitrogen/rel/nitrogen/etc/vm.args -- console
Root: /Users/rfatahi/nitrogen/rel/nitrogen
{error_logger,{{2013,6,26},{15,52,55}},"Protocol: ~p: register error: ~p~n",["inet_tcp",{{badmatch,{error,duplicate_name}},[{inet_tcp_dist,listen,1,[{file,"inet_tcp_dist.erl"},{line,70}]},{net_kernel,start_protos,4,[{file,"net_kernel.erl"},{line,1314}]},{net_kernel,start_protos,3,[{file,"net_kernel.erl"},{line,1307}]},{net_kernel,init_node,2,[{file,"net_kernel.erl"},{line,1197}]},{net_kernel,init,1,[{file,"net_kernel.erl"},{line,357}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}]}
{error_logger,{{2013,6,26},{15,52,55}},crash_report,[[{initial_call,{net_kernel,init,['Argument__1']}},{pid,<0.20.0>},{registered_name,[]},{error_info,{exit,{error,badarg},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,320}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},{ancestors,[net_sup,kernel_sup,<0.10.0>]},{messages,[]},{links,[#Port<0.430>,<0.17.0>]},{dictionary,[{longnames,true}]},{trap_exit,true},{status,running},{heap_size,987},{stack_size,24},{reductions,519}],[]]}
{error_logger,{{2013,6,26},{15,52,55}},supervisor_report,[{supervisor,{local,net_sup}},{errorContext,start_error},{reason,{'EXIT',nodistribution}},{offender,[{pid,undefined},{name,net_kernel},{mfargs,{net_kernel,start_link,[['nitr...@127.0.0.1',longnames]]}},{restart_type,permanent},{shutdown,2000},{child_type,worker}]}]}
{error_logger,{{2013,6,26},{15,52,55}},supervisor_report,[{supervisor,{local,kernel_sup}},{errorContext,start_error},{reason,shutdown},{offender,[{pid,undefined},{name,net_sup},{mfargs,{erl_distribution,start_link,[]}},{restart_type,permanent},{shutdown,infinity},{child_type,supervisor}]}]}
{error_logger,{{2013,6,26},{15,52,55}},std_info,[{application,kernel},{exited,{shutdown,{kernel,start,[normal,[]]}}},{type,permanent}]}
{"Kernel pid terminated",application_controller,"{application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})


Have been at it for a while, and looking at promising threads from the mailing list from before. Will have to put in some elbow grease with the thinking cap on, just no more today! I'll probably be at it again tomorrow. If I get absolutely stuck after ~40 hours, I may ask for some assistance!
Message has been deleted

rex f

unread,
Jun 27, 2013, 2:11:32 AM6/27/13
to nitro...@googlegroups.com, rex f, gu...@sigma-star.com
So weird!!

I took a couple hours away (having closed the terminal session completely), I restarted, and EShell works like a charm! I wonder if the program is really human, and it was the time away that did it.. haha!

Jesse Gumm

unread,
Jun 27, 2013, 10:31:30 AM6/27/13
to nitro...@googlegroups.com, rex f

That's good to hear.

I was out for the rest of the night last night so I couldn't respond, but that massively cryptic error you were seeing looks to have been made  by having a second running instance of Nitrogen. The key there was 'duplicate_name', which says that erlang EPMD already had an instance of the same node name registered (likely nitr...@127.0.0.1, as that's the default in etc/vm.args).

-Jesse

On Jun 27, 2013 1:11 AM, "rex f" <aug...@gmail.com> wrote:
So weird!!

I took a couple hours away (having closed the terminal session completely), I restarted, and EShell works like a charm! I wonder if the program is really human, and it was the time away that did it.. haha!

--
Reply all
Reply to author
Forward
0 new messages