Hi! I would love to start my journey with Ruby on Rails but many of my attempts had failed miserably. Here are few of my problems when going through Getting Started with Rails:
- gem install rails failes on every attempt. I tried on two different computers one is MacBook and other is old Lenovo laptop with Fedora onboard. I always get connection error. I have checked in three different locations and Internet providers. I dont use proxy or anything. My error is:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Gem::Net::OpenTimeout: Failed to open TCP connection to rubygems.org:443 (execution expired) (https://rubygems.org/specs.4.8.gz)
Apart from those attempts I have read multiple threads on forums, blogs, etc. Trying solutions with SSL certificate, getting gems through http rather than https and so on. Asked milion questions to chatgpt but nothing helped.
- Getting Started with Dev Containers after failing on many attempts with installing rails. I have tried my luck with docker. Using this way of starting new project I got an error:
Step 5/8 : RUN groupadd -g $GROUP_ID app && useradd -u $USER_ID -g app -m app
---> Running in 31095dedeb84
groupadd: GID '0' already exists
The command '/bin/sh -c groupadd -g $GROUP_ID app && useradd -u $USER_ID -g app -m app' returned a non-zero code: 4
thread 'main' panicked at src/main.rs:41:5:
assertion failed: status.success()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
To combat that error I ve had clone rails-new repository and just changed line 5 in Dockerfile.unix to just “RUN useradd app” and builed the tool. Everything is fine up until this point:
Successfully tagged rails-new-3.3.4-7.2.0:latest
/usr/local/lib/ruby/3.3.0/fileutils.rb:402:in `mkdir': Permission denied @ dir_s_mkdir - /home/jk/Code/rails-new/rails-new (Errno::EACCES)
I have added docker group to user, tried to run rails-new with sudo and as logged in root but every time I got this error. I have heard about great developer experience with Rails but why am I going through such problems just trying to start project? If you gone through such problems or may know where is problem please help me. With regards frontend developer derailed from starting new project.