[erlang-questions] Looking for slides of a lightning talk

Ian hobson42@REDACTED
Thu Jul 12 00:30:43 CEST 2012


On 11/07/2012 11:47, Thomas Lindgren wrote:
> 1. Too few dedicated erlang web programmers, so still a lot of DIY. This may be a bootstrapping/community issue. Which is nontrivial, by the way.
>
> 2. Packages: Let me gripe a bit. At work, we've had endless trouble with Ruby gems, some hair tearing with CPAN, and have spent a couple of man years on packaging for RH and Debian. The whole process is still pretty clunky and hacky. So not a solved problem in the rest of the world either IMO and the erlang way has some advantages. But I agree that more love is needed to catch up, especially on usability.
Things need A LOT more love. I want to use cowboy to write some web 
software. Looks easy enough. There are Erlang drivers for the database I 
need to use, so all looks OK to proceed.  I have just started with 
Erlang so not too familiar with things yet. This is my experience.

1) Found cowboy needs rebar - and rebar documentation is 
thin/non-existent/hiding.

2) Find rebar is not available on windows.  OK. I'll upgrade a VM I have 
to Unbuntu 12:04. (which takes 3 hours, fails and needs nursing back to 
health.  After removing and re-installing some packages things are now 
OK, apart from the occasional crash.  Aside - virtual box provides a 
rather standard environment, so should not be a problem. And I though 
Linux was supposed not to crash like Windows. Not my experience.  Oh 
well - press on.

3) I discover that the install of rebar into an apt-get install of 
Erlang will cause all sort of problems.

In my book that means that at least one of those installs is not simple 
minded, or had inadequate checking.
It is simply wrong. Maybe both. No matter, decide to install from source.

4) Screw up courage and download and compile Erlang 15B - all goes 
well.  Woo-Hoo on a roll here!

5) Download, and compile rebar from source. That appears to work and it 
tells me to put it on the path.

6) Eh? Type "path" - gets "not installed" error message. Back to Google. 
Eventually find the command I need is env.  See path is a whole slew of 
directories.

Which should I use? Will the next upgrade to Ubuntu wipe some of them? 
Don't know. Don't know how to find out. Look in each one and decide that 
/usr/local/bin is probably a fair choice, because it contains erl. Copy 
rebar in.

7) Now I can start the instructions at 
http://blog.pqsdk.org/from-zero-to-deployment-with-cowboy-in-5-minu

Note the title includes the sales pitch "In 5 minutes".  I have already 
spent many hours getting the the start position. (At least I hope its 
the start position).

8) Issue first command and find hg is not an installed command. Apt-get 
install hg can't find the package.

It wasn't the start position!  Google turns up that hg is actually 
called mercurial and gives me the magic incantation to install it.

9) hg installs and I get to clone woody from bitbucket.  Step 1 complete.

10) Next command is ./app.sh cowgirl .   I think that create the app (or 
at least its framework). It reports no errors.

11) Then ./build-compile.sh  - OK, build and compile.  NO errors. Great.

12) Next comes  ./build-release.sh

This fails saying files exist and were not generated. It adds that I 
need force=1 on the command line to force it. Why? If forcing is a good 
idea, the software should just do it. Heck, its only to learn. I can 
delete and start over if necessary - just press on. Add force=1 to the 
command line.

13) When I do I get this.

ian@REDACTED:~/projects/cowgirl$ ./build-release.sh force=1
==> rel (create-node)
ERROR: One or more files already exist on disk and were not generated:
     * "reltool.config"
     * "files/erl"
     * "files/nodetool"
     * "files/cowgirl"
     * "files/app.config"
     * "files/vm.args"
To force overwriting, specify force=1 on the command line.
==> rel (generate)
ERROR: generate failed while processing /home/ian/projects/cowgirl/rel: 
{'EXIT',{{badmatch,{error,"Release \"cowgirl\" uses non existing 
application cowgirl"}},
          [{rebar_reltool,generate,2,[]},
           {rebar_core,run_modules,4,[]},
           {rebar_core,execute,4,[]},
           {rebar_core,process_dir,4,[]},
           {rebar_core,process_each,5,[]},
           {rebar_core,process_dir,4,[]},
           {rebar_core,process_commands,1,[]},
           {rebar,main,1,[]}]}}
ian@REDACTED:~/projects/cowgirl$

This is copy/pasted from the log, so I can see I did indeed spell force 
correctly.

Where now? Is the pre-existence of those files a problem? I have no 
idea, and no idea how to find out. However experience tells me to make a 
real effort to fix the first error, even if later ones can be ignored. 
Should I delete them all and try again?

What does the error in the generate mean? It can't mean the application 
cowgirl does not exist because hg/mercurial  brought it down without 
errors and app.sh created it without errors.

The talk is right. Erlang is just too damn difficult to do the easy stuff.

It may have been humorously presented (I wasn't there), but the 
take-away it so true.

Early difficulties are putting off many would-be adopters.

(And I'm stuck!  Help appreciated! )

Regards

Ian




More information about the erlang-questions mailing list