I get the following error when trying to create a new rails application:
root@fb651d3863f0:/app# rails new truffleruby --api
Based on the specified options, the following options will also be activated:
--skip-javascript [due to --api]
--skip-hotwire [due to --skip-javascript]
--skip-asset-pipeline [due to --api]
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create .gitattributes
create Gemfile
<internal:core> core/truffle/process_operations.rb:521:in `spawn': No such file or directory - No such file or directory - git (Errno::ENOENT)
from <internal:core> core/truffle/process_operations.rb:135:in `spawn'
from <internal:core> core/io.rb:686:in `popen'
from <internal:core> core/kernel.rb:178:in ``'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/app_base.rb:733:in `user_default_branch'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/app_base.rb:737:in `git_init_command'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/rails/app/app_generator.rb:25:in `method_missing'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/rails/app/app_generator.rb:87:in `version_control'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/app_base.rb:150:in `build'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/generators/rails/app/app_generator.rb:346:in `create_root_files'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:134:in `block in invoke_all'
from <internal:core> core/enumerable.rb:104:in `map'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:134:in `invoke_all'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/group.rb:232:in `dispatch'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/base.rb:584:in `start'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/commands/application/application_command.rb:28:in `perform'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/command/base.rb:178:in `invoke_command'
from /usr/local/bundle/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/command/base.rb:73:in `perform'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/command.rb:71:in `block in invoke'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/command.rb:149:in `with_argv'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/command.rb:69:in `invoke'
from /usr/local/bundle/gems/railties-7.1.3.3/lib/rails/cli.rb:21:in `<top (required)>'
from <internal:core> core/kernel.rb:229:in `gem_original_require'
from <internal:/usr/local/lib/mri/rubygems/core_ext/kernel_require.rb>:85:in `require'
from /usr/local/bundle/gems/railties-7.1.3.3/exe/rails:10:in `<top (required)>'
from <internal:core> core/kernel.rb:378:in `load'
from /usr/local/bundle/bin/rails:25:in `<main>'
Data for context, I am running the code in an isolated docker container with args
TRUFFLERUBY_VERSION: "24.0.1"
PG_MAJOR: "16"
ARG DISTRO_NAME=bookworm
FROM debian:$DISTRO_NAME-slim
ARG DISTRO_NAME
ARG TRUFFLERUBY_VERSION
ENV LANG C.UTF-8
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
bzip2 \
ca-certificates \
libffi-dev \
libgmp-dev \
libssl-dev \
libyaml-dev \
procps \
zlib1g-dev \
build-essential \
gnupg2 \
curl \
wget \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
RUN set -eux ;\
wget -q https://github.com/oracle/truffleruby/releases/download/graal-$TRUFFLERUBY_VERSION/truffleruby-jvm-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz ; tar -xzf truffleruby-jvm-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz -C /usr/local --strip-components=1 ;\
rm truffleruby-jvm-$TRUFFLERUBY_VERSION-linux-amd64.tar.gz ;\
/usr/local/lib/truffle/post_install_hook.sh ;\
truffleruby-polyglot-get java ;\
ruby --version ;\
gem --version ;\
bundle --version
ENV PATH="/usr/local/jvm/bin:${PATH}"
ARG PG_MAJOR
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /usr/share/keyrings/postgres-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/postgres-archive-keyring.gpg] https://apt.postgresql.org/pub/repos/apt/" \
$DISTRO_NAME-pgdg main $PG_MAJOR | tee /etc/apt/sources.list.d/postgres.list > /dev/null
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
libpq-dev \
libsodium-dev \
postgresql-client-$PG_MAJOR \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# Application dependencies
# We use an external Aptfile for this, stay tuned
COPY Aptfile /tmp/Aptfile
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
$(grep -Ev '^\s*#' /tmp/Aptfile | xargs) \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
# don't create ".bundle" in all our apps
ENV GEM_HOME /usr/local/bundle
ENV BUNDLE_SILENCE_ROOT_WARNING=1 \
BUNDLE_APP_CONFIG="$GEM_HOME"
ENV PATH $GEM_HOME/bin:$PATH
# adjust permissions of a few directories for running "gem install" as an arbitrary user
RUN mkdir -p "$GEM_HOME" && chmod 777 "$GEM_HOME"
# Upgrade RubyGems and install the latest Bundler version
RUN gem update --system && \
gem install bundler
# Create a directory for the app code
RUN mkdir -p /app
WORKDIR /app
# Document that we're going to expose port 3000
EXPOSE 3000
# Use Bash as the default command
CMD ["/usr/bin/bash"]
After that, I install rails through gem install rails
I get the following error when trying to create a new rails application:
Data for context, I am running the code in an isolated docker container with args TRUFFLERUBY_VERSION: "24.0.1" PG_MAJOR: "16"
After that, I install rails through
gem install rails
And after trying to create the application as I showed in the beginning.