February 01, 2020
On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote:
> On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
>> Hi
>> I want to start a small server, that will be accessible form outside. Not a huge deal right?
>> Not quite.
>>
>> [...]
>
> What version of dub did you install? 1.19 should be the latest.

PS:
As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases

I call ./build.d - and everything stops, and machine crashes.

Same for the master branch
February 01, 2020
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
> Hi
> I want to start a small server, that will be accessible form outside. Not a huge deal right?
> Not quite.
>
> My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>
> DMD : DMD64 D Compiler v2.090.0
> Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
>
>
> Now, I try to install dub from the official repo.
> Then I do
>
> * dub init server -t vibe.d
> * cd server
> * dub
>
> I hit this issue : https://github.com/dlang/dub/issues/1712
>
> As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases
>
> I call ./build.d - and everything stops, and machine crashes.
>
> I then try to install DaNode: https://github.com/DannyArends/DaNode
>
> It breaks with : module std.algorithm import 'mean' not found
>
> Then I try to install the Hunt Framework. It breaks with : basic type
> expected, not foreach
>
>
> Please help. I really want this issue to be resolved-

Hey Seany,

DaNode author here, the mean function is only used to compute some server statistics. I am sorry to hear it didn't compile out of the box with the latest DMD compiler, I only tested up-to 2.088.0

I just installed the latest version 2.090.0 but also using this version it compiles fine. Looking into the dlang docs it seems it was moved from std.algorithm to std.algorithm.iteration, I wonder why it doesn't find this function.

However I just added a mean function to the web server since it should always find this function.

Could you pull the latest master branch and try compiling it again ?

dub -- -p=8080

then see if the web server works by navigating to

http://localhost:8080/

let me know if you run into any other issues

Kind regards,
Danny
February 01, 2020
On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote:
> On Saturday, 1 February 2020 at 14:42:58 UTC, Seb wrote:
>> On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
>>> Hi
>>> I want to start a small server, that will be accessible form outside. Not a huge deal right?
>>> Not quite.
>>>
>>> [...]
>>
>> What version of dub did you install? 1.19 should be the latest.
>
> PS:
> As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases
>
> I call ./build.d - and everything stops, and machine crashes.
>
> Same for the master branch

Hey Seany,

A quick follow up post. I think/suspect that something might be broken in your dub installation if the mean import is not found. This is the first import from the phobos standard library in the project.

Could you try compiling the DaNode web server without using dub ?

git clone https://github.com/DannyArends/DaNode.git
cd DaNode
rdmd danode/server.d -p=8080

This should work, when you have a working D+Phobos standard library installation. If this throws error of being unable to find the canFind import (now the first one) then somehing in your dub/dmd installation is broken and you will probably have to reinstall dmd+dub

Kind regards,
Danny
February 02, 2020
I solved this by following:

sudo wget https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list
sudo apt-get update --allow-insecure-repositories
sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring
sudo apt-get update && sudo apt-get install dmd-compiler dub


then dub showed the error : out of memory.

I applied: dub --build-mode=singleFile

That seems to work
February 02, 2020
On Saturday, 1 February 2020 at 22:25:38 UTC, Danny Arends wrote:
> On Saturday, 1 February 2020 at 20:06:42 UTC, seany wrote:
>> [...]
>
> Hey Seany,
>
> A quick follow up post. I think/suspect that something might be broken in your dub installation if the mean import is not found. This is the first import from the phobos standard library in the project.
>
> Could you try compiling the DaNode web server without using dub ?
>
> git clone https://github.com/DannyArends/DaNode.git
> cd DaNode
> rdmd danode/server.d -p=8080
>
> This should work, when you have a working D+Phobos standard library installation. If this throws error of being unable to find the canFind import (now the first one) then somehing in your dub/dmd installation is broken and you will probably have to reinstall dmd+dub
>
> Kind regards,
> Danny

I will test this tomorrow.
February 06, 2020
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
> Hi
> I want to start a small server, that will be accessible form outside. Not a huge deal right?
> Not quite.
>
> My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>
> DMD : DMD64 D Compiler v2.090.0
> Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
>
>
> Now, I try to install dub from the official repo.
> Then I do
>
> * dub init server -t vibe.d
> * cd server
> * dub
>
> I hit this issue : https://github.com/dlang/dub/issues/1712
>
> As suggested, i try to build dub from github, following: https://github.com/dlang/dub/releases
>
> I call ./build.d - and everything stops, and machine crashes.
>
> I then try to install DaNode: https://github.com/DannyArends/DaNode
>
> It breaks with : module std.algorithm import 'mean' not found
>
> Then I try to install the Hunt Framework. It breaks with : basic type
> expected, not foreach
>
>
> Please help. I really want this issue to be resolved-

## 1. For simple server you can using hunt-http library.

Sample code:
```
import hunt.http;

void main()
{
    HttpServer server = HttpServer.builder()
        .setListener(8080, "0.0.0.0")
        .onPost("/", (RoutingContext context) {
            context.end("Hello World!");
        })
        .onGet("/user/:name", (RoutingContext ctx) {
            string name = ctx.getRouterParameter("name");

            ctx.write("Hello " ~ name);
            ctx.end();
        })
        .build();

    server.start();
}
```

## 2. For full server, you can using hunt-skeleton (hunt-framework based):
```bash
git clone https://github.com/huntlabs/hunt-skeleton.git myproject/
cd myproject/
dub run -v
```

You can Add pages in `config/routes` , like this:
```
GET   /   index.index
GET   /user/{name}    user.detail
```

Add Controller file `controller/UserController.d` :
```
module app.controller.UserController;

import hunt.framework;

class UserController : Controller
{
    mixin MakeController;

    @Action
    string detail(string name)
    {
        return "Hello " ~ name;
    }
}
```

Build and run it:
```
cd myproject/
dub run -v
```

You can see it in the borwser:
```
http://localhost:8080
```
February 06, 2020
On Saturday, 1 February 2020 at 10:35:52 UTC, seany wrote:
> Hi
> I want to start a small server, that will be accessible form outside. Not a huge deal right?
> Not quite.
>
> My machine: 4.15.0-66-generic #75-Ubuntu SMP Tue Oct 1 05:24:09 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
>
> DMD : DMD64 D Compiler v2.090.0
> Copyright (C) 1999-2019 by The D Language Foundation, All Rights Reserved written by Walter Bright
>

How much memory does this machine have? Is it a virtual machine provided by a hosting company? My suspicion is that your server is very slow for some peculiar reason.
1 2
Next ›   Last »