R
Railway17mo ago
CrawKatt

Problems deploying Discord Bot written in Rust in Railway

Hi, I'm new to Railway and it's the first time I use Railway, I tried to deploy my Discord Bot from my GitHub repository and I got this error stating that Cmake is not installed but I don't understand what I should do to fix that problem. I leave the build log below (the text is very long, so I have to send it as one file): thank you very much in advance proyect id: 142f2800-5554-446f-a489-23797460545a
Solution:
```dockerfile FROM rust:1.71.0-slim RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential ...
Jump to solution
107 Replies
Percy
Percy17mo ago
Project ID: 142f2800-5554-446f-a489-23797460545a
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
add a nixpacks.toml file with this to your project
[phases.setup]
nixPkgs = ["...", "cmake"]
[phases.setup]
nixPkgs = ["...", "cmake"]
CrawKatt
CrawKattOP17mo ago
I just added the file but it still gives the same problem ;-;
Brody
Brody17mo ago
well I'm out of ideas
eirk
eirk17mo ago
seems like its the crate audiopus is upset it probs has a c/c++ api so it needs cmake to build
CrawKatt
CrawKattOP17mo ago
the problem is how to install cmake on railway? 😅 in my PC works perfectly
eirk
eirk17mo ago
i think u shoudl use a dockerfile
Brody
Brody17mo ago
lets try installing with apt instead of nix
[phases.setup]
aptPkgs = ["...", "cmake"]
[phases.setup]
aptPkgs = ["...", "cmake"]
CrawKatt
CrawKattOP17mo ago
the same thing happens ;-; I have a dockerfile although I'm new to Docker so I'm not sure if it's right. 😅
Brody
Brody17mo ago
then im going with eirk's recommendation bruh that would have been good to know
CrawKatt
CrawKattOP17mo ago
😅
Brody
Brody17mo ago
these nixpacks.toml files would have done nothing send the dockerfile please
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
its not doing anything special, delete it
CrawKatt
CrawKattOP17mo ago
now i have this error:
==============
Using Nixpacks
==============

context: 44cb3a86430f97ac21b5537a9f75af87

Nixpacks file based configuration is experimental and may change



╔══════════════════════════════ Nixpacks v1.11.0 ══════════════════════════════╗
║ build │ cargo run ║
║──────────────────────────────────────────────────────────────────────────────║
║ setup │ binutils, gcc, (rust-bin.stable.latest.default.override { ║
║ │ targets = ["x86_64-unknown-linux-musl"]; }), musl, musl.dev, ║
║ │ cmake ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ ./bin/ryuko_bot_discord ║
╚══════════════════════════════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile

#1 transferring dockerfile: 2.15kB done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s

Dockerfile:12
-------------------
10 |
11 | ARG NIXPACKS_METADATA RAILWAY_DEPLOYMENT_ID RAILWAY_ENVIRONMENT RAILWAY_ENVIRONMENT_ID RAILWAY_GIT_AUTHOR RAILWAY_GIT_BRANCH RAILWAY_GIT_COMMIT_MESSAGE RAILWAY_GIT_COMMIT_SHA RAILWAY_GIT_REPO_NAME RAILWAY_GIT_REPO_OWNER RAILWAY_PROJECT_ID RAILWAY_SERVICE_ID RAILWAY_SERVICE_NAME RAILWAY_SERVICE_RYUKOBOT_URL RAILWAY_SNAPSHOT_ID RAILWAY_STATIC_URL ROCKET_ADDRESS
12 | >>> ENV =$ NIXPACKS_METADATA=$NIXPACKS_METADATA RAILWAY_DEPLOYMENT_ID=$RAILWAY_DEPLOYMENT_ID RAILWAY_ENVIRONMENT=$RAILWAY_ENVIRONMENT RAILWAY_ENVIRONMENT_ID=$RAILWAY_ENVIRONMENT_ID RAILWAY_GIT_AUTHOR=$RAILWAY_GIT_AUTHOR RAILWAY_GIT_BRANCH=$RAILWAY_GIT_BRANCH RAILWAY_GIT_COMMIT_MESSAGE=$RAILWAY_GIT_COMMIT_MESSAGE RAILWAY_GIT_COMMIT_SHA=$RAILWAY_GIT_COMMIT_SHA RAILWAY_GIT_REPO_NAME=$RAILWAY_GIT_REPO_NAME RAILWAY_GIT_REPO_OWNER=$RAILWAY_GIT_REPO_OWNER RAILWAY_PROJECT_ID=$RAILWAY_PROJECT_ID RAILWAY_SERVICE_ID=$RAILWAY_SERVICE_ID RAILWAY_SERVICE_NAME=$RAILWAY_SERVICE_NAME RAILWAY_SERVICE_RYUKOBOT_URL=$RAILWAY_SERVICE_RYUKOBOT_URL RAILWAY_SNAPSHOT_ID=$RAILWAY_SNAPSHOT_ID RAILWAY_STATIC_URL=$RAILWAY_STATIC_URL ROCKET_ADDRESS=$ROCKET_ADDRESS
13 |
14 | # build phase
-------------------
ERROR: failed to solve: dockerfile parse error on line 12: ENV names can not be blank

Error: Docker build failed
==============
Using Nixpacks
==============

context: 44cb3a86430f97ac21b5537a9f75af87

Nixpacks file based configuration is experimental and may change



╔══════════════════════════════ Nixpacks v1.11.0 ══════════════════════════════╗
║ build │ cargo run ║
║──────────────────────────────────────────────────────────────────────────────║
║ setup │ binutils, gcc, (rust-bin.stable.latest.default.override { ║
║ │ targets = ["x86_64-unknown-linux-musl"]; }), musl, musl.dev, ║
║ │ cmake ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ ./bin/ryuko_bot_discord ║
╚══════════════════════════════════════════════════════════════════════════════╝


#1 [internal] load build definition from Dockerfile

#1 transferring dockerfile: 2.15kB done
#1 DONE 0.0s

#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s

Dockerfile:12
-------------------
10 |
11 | ARG NIXPACKS_METADATA RAILWAY_DEPLOYMENT_ID RAILWAY_ENVIRONMENT RAILWAY_ENVIRONMENT_ID RAILWAY_GIT_AUTHOR RAILWAY_GIT_BRANCH RAILWAY_GIT_COMMIT_MESSAGE RAILWAY_GIT_COMMIT_SHA RAILWAY_GIT_REPO_NAME RAILWAY_GIT_REPO_OWNER RAILWAY_PROJECT_ID RAILWAY_SERVICE_ID RAILWAY_SERVICE_NAME RAILWAY_SERVICE_RYUKOBOT_URL RAILWAY_SNAPSHOT_ID RAILWAY_STATIC_URL ROCKET_ADDRESS
12 | >>> ENV =$ NIXPACKS_METADATA=$NIXPACKS_METADATA RAILWAY_DEPLOYMENT_ID=$RAILWAY_DEPLOYMENT_ID RAILWAY_ENVIRONMENT=$RAILWAY_ENVIRONMENT RAILWAY_ENVIRONMENT_ID=$RAILWAY_ENVIRONMENT_ID RAILWAY_GIT_AUTHOR=$RAILWAY_GIT_AUTHOR RAILWAY_GIT_BRANCH=$RAILWAY_GIT_BRANCH RAILWAY_GIT_COMMIT_MESSAGE=$RAILWAY_GIT_COMMIT_MESSAGE RAILWAY_GIT_COMMIT_SHA=$RAILWAY_GIT_COMMIT_SHA RAILWAY_GIT_REPO_NAME=$RAILWAY_GIT_REPO_NAME RAILWAY_GIT_REPO_OWNER=$RAILWAY_GIT_REPO_OWNER RAILWAY_PROJECT_ID=$RAILWAY_PROJECT_ID RAILWAY_SERVICE_ID=$RAILWAY_SERVICE_ID RAILWAY_SERVICE_NAME=$RAILWAY_SERVICE_NAME RAILWAY_SERVICE_RYUKOBOT_URL=$RAILWAY_SERVICE_RYUKOBOT_URL RAILWAY_SNAPSHOT_ID=$RAILWAY_SNAPSHOT_ID RAILWAY_STATIC_URL=$RAILWAY_STATIC_URL ROCKET_ADDRESS=$ROCKET_ADDRESS
13 |
14 | # build phase
-------------------
ERROR: failed to solve: dockerfile parse error on line 12: ENV names can not be blank

Error: Docker build failed
Brody
Brody17mo ago
show me a screenshot of your service variables
CrawKatt
CrawKattOP17mo ago
enviorment variables?
Brody
Brody17mo ago
service variables
CrawKatt
CrawKattOP17mo ago
Where can I get them? 😅
Brody
Brody17mo ago
from the service on railway
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
bruh what is that what is .env for
CrawKatt
CrawKattOP17mo ago
ohh, I think the token did not go there 😅 😭
Brody
Brody17mo ago
delete it
CrawKatt
CrawKattOP17mo ago
ok
CrawKatt
CrawKattOP17mo ago
now i have this error:
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
[phases.setup]
nixPkgs = ["...", "cmake", "openssl"]
[phases.setup]
nixPkgs = ["...", "cmake", "openssl"]
CrawKatt
CrawKattOP17mo ago
i have this error:
CrawKatt
CrawKattOP17mo ago
[phases.setup]
aptPkgs = ["...", "cmake", "openssl", "openssl-sys"]
[phases.setup]
aptPkgs = ["...", "cmake", "openssl", "openssl-sys"]
I guess it goes like this now right?
Brody
Brody17mo ago
try this
CrawKatt
CrawKattOP17mo ago
I tried it this way and it gave me the error I just posted. I have not yet upgraded with "openssl-sys". ohh, nixpgs i understand now
CrawKatt
CrawKattOP17mo ago
the same
CrawKatt
CrawKattOP17mo ago
you may need to add openssl-sys
Brody
Brody17mo ago
openssl-sys is not a nix package
CrawKatt
CrawKattOP17mo ago
maybe it is libssl-dev
Brody
Brody17mo ago
thats also not a nix packages
eirk
eirk17mo ago
did you code this bot
Brody
Brody17mo ago
you can try them as apt packages though
CrawKatt
CrawKattOP17mo ago
yes, locally on mi PC works perfectly ok
Brody
Brody17mo ago
[phases.setup]
aptPkgs = ["...", "cmake", "openssl", "libssl-dev"]
[phases.setup]
aptPkgs = ["...", "cmake", "openssl", "libssl-dev"]
CrawKatt
CrawKattOP17mo ago
now i have this error:
CrawKatt
CrawKattOP17mo ago
ahh, I don't know why copying copies incompletely ;-;
Brody
Brody17mo ago
skill issue?
CrawKatt
CrawKattOP17mo ago
maybe it's a bug in my Arch Linux, sometimes these things happen to me.
Brody
Brody17mo ago
common linux L
CrawKatt
CrawKattOP17mo ago
#13 3.074 error: failed to run custom build command for `openssl-sys v0.9.90`
#13 3.074
#13 3.074 Caused by:
#13 3.075 process didn't exit successfully: `/app/target/debug/build/openssl-sys-92d397afd81c19e3/build-script-main` (exit status: 101)
#13 3.075 --- stdout
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
#13 3.075 OPENSSL_LIB_DIR unset
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
#13 3.075 OPENSSL_INCLUDE_DIR unset
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_DIR
#13 3.075 OPENSSL_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
#13 3.075 cargo:rerun-if-env-changed=HOST_PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_STATIC
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
#13 3.074 error: failed to run custom build command for `openssl-sys v0.9.90`
#13 3.074
#13 3.074 Caused by:
#13 3.075 process didn't exit successfully: `/app/target/debug/build/openssl-sys-92d397afd81c19e3/build-script-main` (exit status: 101)
#13 3.075 --- stdout
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
#13 3.075 OPENSSL_LIB_DIR unset
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
#13 3.075 OPENSSL_INCLUDE_DIR unset
#13 3.075 cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
#13 3.075 X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_DIR
#13 3.075 OPENSSL_DIR unset
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
#13 3.075 cargo:rerun-if-env-changed=HOST_PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_STATIC
#13 3.075 cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
#13 3.075 cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
Brody
Brody17mo ago
dockerfile time
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
openssl \
libssl-dev

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
openssl \
libssl-dev

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
CrawKatt
CrawKattOP17mo ago
CrawKatt
CrawKattOP17mo ago
now is cmake 😭
#9 ERROR: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101
-----
> [5/5] RUN cargo build --release:
#9 29.86 CMakeLists.txt:5 (get_package_version)
#9 29.86
#9 29.86
#9 29.86 CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
#9 29.86 thread 'main' panicked at '
#9 29.86 command did not execute successfully, got: exit status: 1

#9 29.86
#9 29.86 build script failed, must exit now', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
#9 29.86 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#9 29.86 warning: build failed, waiting for other jobs to finish...
-----
Dockerfile:13
-------------------
11 | COPY . .
12 |
13 | >>> RUN cargo build --release
14 |
15 | ENTRYPOINT ["/bin/ryuko_bot_discord"]

-------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101

#9 ERROR: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101
-----
> [5/5] RUN cargo build --release:
#9 29.86 CMakeLists.txt:5 (get_package_version)
#9 29.86
#9 29.86
#9 29.86 CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
#9 29.86 thread 'main' panicked at '
#9 29.86 command did not execute successfully, got: exit status: 1

#9 29.86
#9 29.86 build script failed, must exit now', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5
#9 29.86 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
#9 29.86 warning: build failed, waiting for other jobs to finish...
-----
Dockerfile:13
-------------------
11 | COPY . .
12 |
13 | >>> RUN cargo build --release
14 |
15 | ENTRYPOINT ["/bin/ryuko_bot_discord"]

-------------------
ERROR: failed to solve: process "/bin/sh -c cargo build --release" did not complete successfully: exit code: 101

Brody
Brody17mo ago
well get there, hopefully
Solution
Brody
Brody17mo ago
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/bin/ryuko_bot_discord"]
CrawKatt
CrawKattOP17mo ago
that worked 😄
Brody
Brody17mo ago
now put your discord bot token in the service variables
CrawKatt
CrawKattOP17mo ago
ok, thank you very so much and i sorry for the inconvenience with me 😅
Brody
Brody17mo ago
no worries
CrawKatt
CrawKattOP17mo ago
ups ========================= Container failed to start =========================  Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/ryuko_bot_discord": stat /bin/ryuko_bot_discord: no such file or directory: unknown 😅
Brody
Brody17mo ago
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/app/bin/ryuko_bot_discord"]
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/app/bin/ryuko_bot_discord"]
CrawKatt
CrawKattOP17mo ago
the same error, maybe it is in the target folder. the last line is supposed to execute the binary, right?
Brody
Brody17mo ago
when you run cargo build --release locally, where does the bin end up and what's the name of it
CrawKatt
CrawKattOP17mo ago
a moment please, I compiling with release
CrawKatt
CrawKattOP17mo ago
CrawKatt
CrawKattOP17mo ago
target/release/ryuko_bot_discord
Brody
Brody17mo ago
cool
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/app/target/release/ryuko_bot_discord"]
FROM rust:1.71.0-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
openssl \
libssl-dev \
pkg-config

WORKDIR /app

COPY . .

RUN cargo build --release

ENTRYPOINT ["/app/target/release/ryuko_bot_discord"]
CrawKatt
CrawKattOP17mo ago
now it works
Brody
Brody17mo ago
are you sure
CrawKatt
CrawKattOP17mo ago
now I just have to add my token and the ytp-dl and FFmpeg dependencies. thread 'main' panicked at 'Missing DISCORD_TOKEN env var, see README for more information.: NotPresent', src/main.rs:69:18 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace it works
Brody
Brody17mo ago
downloading YouTube videos is very much not allowed on railway
CrawKatt
CrawKattOP17mo ago
ohh
Brody
Brody17mo ago
you don't be able to host your bot on railway all this just for me to end up telling you that you can't host the bot on railway
CrawKatt
CrawKattOP17mo ago
Well, never mind, that was just for the music commands but I can do without that.
Brody
Brody17mo ago
yep remove functionality that downloads from YouTube, or any other functionality that does things you're not supposed to, and then you're fine
CrawKatt
CrawKattOP17mo ago
ok, thank you very much for the help
Brody
Brody17mo ago
add your token to the service variables
CrawKatt
CrawKattOP17mo ago
with " " or without " "?
Brody
Brody17mo ago
without quotes send me a screenshot just to make sure
CrawKatt
CrawKattOP17mo ago
I added the token without quotes
Brody
Brody17mo ago
screenshot please to clarify, I am not asking to see the token itself, please keep that hidden
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
why are you calling it .env I don't understand
CrawKatt
CrawKattOP17mo ago
I thought that was to create the file and that it would give the name assigned there. 😅 sorry i am a bit new to deploys.
Brody
Brody17mo ago
it's a bot token, so the name should be DISCORD_TOKEN like the error message told you
CrawKatt
CrawKattOP17mo ago
I just realized and fixed it 😅
CrawKatt
CrawKattOP17mo ago
now it works
Brody
Brody17mo ago
remove any build or start commands you may have set in the service settings
CrawKatt
CrawKattOP17mo ago
no compile or start command in the configuration 👍🏻
Brody
Brody17mo ago
your screenshot said otherwise
CrawKatt
CrawKattOP17mo ago
ohh maybe it's the nixpacks because I haven't removed it yet. 😅
Brody
Brody17mo ago
or you have set a build command in the service settings
CrawKatt
CrawKattOP17mo ago
Brody
Brody17mo ago
well delete your nixpacks.toml and see if that warning goes away
CrawKatt
CrawKattOP17mo ago
ok did not disappear, maybe it is because of the RUN cargo build --release
Brody
Brody17mo ago
not because of that show me your current railway.json please
CrawKatt
CrawKattOP17mo ago
that's in the service? because I don't have a railway.json in my project 😅
Brody
Brody17mo ago
you can see this in the details tab
CrawKatt
CrawKattOP17mo ago
JSON
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"buildCommand": "cargo run",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"buildCommand": "cargo run",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
Brody
Brody17mo ago
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
now save that as a railway.json file in your project
CrawKatt
CrawKattOP17mo ago
the strange thing is that it keeps on giving this warning but it already recognizes the json and for some reason the run charge is added on its own
Brody
Brody17mo ago
does the JSON in the details tab have a cargo run build command?
CrawKatt
CrawKattOP17mo ago
JSON

{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"buildCommand": "cargo run",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
JSON

{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"buildCommand": "cargo run",
"dockerfilePath": "Dockerfile"
},
"deploy": {
"numReplicas": 1,
"restartPolicyType": "NEVER"
}
}
the "cargo run" is added by itself.
CrawKatt
CrawKattOP17mo ago
GitHub
RyukoBot/railway.json at main · CrawKatt/RyukoBot
Bot de Discord con funciones y características similares a TeloxBot y mucho más - CrawKatt/RyukoBot
Brody
Brody17mo ago
odd but it works, so all good, it's just a warning and has no effect on anything at all
CrawKatt
CrawKattOP17mo ago
ok, thank you very much and i sorry for the problems with me 😅
Brody
Brody17mo ago
no worries!
Want results from more Discord servers?
Add your server