Unable to create GemFile.lock

28 views
Skip to first unread message

Asim Khan

unread,
Jan 2, 2026, 4:01:15 PM (9 days ago) Jan 2
to RubyInstaller
Hi, 
I have been working on my ruby on rails application and wanted to create some unit tests for the application, and encountered some problems when working with RSpec. I have to admit that it is not that easy to use and configure. 

While trying to run the bundle exec rspec spec/folder_name to run the tests for the application, I encountered an error that rpsec is not being recognized although I did added the rspec gem to the Gemfile. 

The suggestion I came across the internet was that I should delete the GemFile.lock and then reinstall all the gems all over again. I did this after trying every option that I know when running bundle install (--clean, --redownload, --no-cache, etc.) 

After deleting the GemFile.lock, I thought that the installation of the new Gemfile.lock will be created without errors, as I have been doing throughout the development of the application, but I am facing an unsual error when running the bundle install command. 

Some io-console 0.8.2 is causing the error and not installing. I deleted most of the gems that I have in Gemfile in order to make a simple GemFile.lock to make the install successful. I even uninstalled Ruby and MSYS from the system, removed all cache folders and bundle folder as well, cleared my local files as well, made fresh installment of ruby 3.3.8 and MSYS into the application and still encountering confusing errors. 

Kindly please help me in this matter, I am stuck with no way out. 

I am using windows and Visual Studio Professional, as it works well for me. 

Regards,
Asim Khan
gemfile.txt
errorlog.txt

Lars Kanis

unread,
Jan 2, 2026, 4:13:57 PM (9 days ago) Jan 2
to RubyInstaller
Hi Asim,

always use the latest patch version of Ruby. This is 3.3.10 not 3.3.8. The `rb_define_method` error is caused by the new gcc-15 compiler, but it is fixed since half a year in Ruby. 

--
Mit freundlichen Grüßen,
Lars Kanis


--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyinstalle...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/rubyinstaller/e900fae4-4aee-442b-ad64-c9ca821d3be7n%40googlegroups.com.

Asim Khan

unread,
Jan 3, 2026, 4:15:09 AM (9 days ago) Jan 3
to RubyInstaller
Thanks I will try that. 

Asim 

Asim Khan

unread,
Jan 4, 2026, 12:57:58 PM (7 days ago) Jan 4
to RubyInstaller
Hi,

So I have successfully installed the RubyInstaller with DevKit 3.3.10 (x64) on my windows, added the folders to the environment and system path. I am using the current gem file in my application.

source 'https://rubygems.org'

ruby '3.3.10'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '7.2.2'
gem 'rake', '~> 13.2'

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem 'sprockets-rails'

# Use postgresql as the database for Active Record
gem 'pg', '~> 1.5', '>= 1.5'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '>= 5.0'

# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
gem 'turbo-rails'

# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
gem 'stimulus-rails'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
gem 'jbuilder'

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[windows jruby]

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false
gem 'cocoon', '~> 1.2', '>= 1.2.15'
gem 'jquery-rails', '~> 4.6'
gem 'dotenv-rails', '~> 3.1', '>= 3.1.2', groups: [:development, :test]
gem 'bootstrap', '~> 5.3', '>= 5.3.3'
gem 'importmap-rails', '~> 2.0', '>= 2.0.1'

group :test do
  # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
  gem 'capybara'
  gem 'selenium-webdriver'
end

but I am still encountering this error:

Installing rack 3.1.19
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
.
.
.
Installing actiontext 7.2.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: C:/Users/Idrees
Khan/.local/share/gem/ruby/3.3.0/gems/psych-5.3.1/ext/psych
C:/Ruby33-x64/bin/ruby.exe extconf.rb
checking for pkg-config for yaml-0.1... not found
checking for yaml.h... no
yaml.h not found
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include=${opt-dir}/include
        --without-opt-include
        --with-opt-lib=${opt-dir}/lib
        --without-opt-lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby33-x64/bin/$(RUBY_BASE_NAME)
        --with-libyaml-source-dir
        --without-libyaml-source-dir
        --with-yaml-0.1-dir
        --without-yaml-0.1-dir
        --with-yaml-0.1-include=${yaml-0.1-dir}/include
        --without-yaml-0.1-include
        --with-yaml-0.1-lib=${yaml-0.1-dir}/lib
        --without-yaml-0.1-lib
--with-yaml-0.1-config
        --without-yaml-0.1-config
        --with-pkg-config
        --without-pkg-config
        --with-libyaml-dir
        --without-libyaml-dir
        --with-libyaml-include=${libyaml-dir}/include
        --without-libyaml-include
        --with-libyaml-lib=${libyaml-dir}/lib
        --without-libyaml-lib

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

C:/Users/Idrees
Khan/.local/share/gem/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/psych-5.3.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Users/Idrees
Khan/.local/share/gem/ruby/3.3.0/gems/psych-5.3.1 for inspection.
Results logged to C:/Users/Idrees
Khan/.local/share/gem/ruby/3.3.0/extensions/x64-mingw-ucrt/3.3.0/psych-5.3.1/gem_make.out
.
.
.
An error occurred while installing psych (5.3.1), and Bundler cannot continue.

In Gemfile:
  dotenv-rails was resolved to 3.2.0, which depends on
    railties was resolved to 7.2.2, which depends on
      irb was resolved to 1.16.0, which depends on
        rdoc was resolved to 7.0.3, which depends on
          psych
 
First I added psych gem to the gem file that did not work, then I manually deleted the gem from my local folders and vendor/bundle folders as well. I also reversed most of my configs in the application to the bundler. But nothing seems to work here

ruby -v
ruby 3.3.10 (2025-10-23 revision 343ea05002) [x64-mingw-ucrt]

bundle config list
Settings are listed in order of priority. The top value will be used.
--delete
Set for your local app (D:/Source/Repos/ezRealEstateROR.git/.bundle/config): "deployment"

system_bindir
Set via BUNDLE_SYSTEM_BINDIR: "C:/Users/Idrees Khan/AppData/Local/Microsoft/WindowsApps"

Regards,
Asim

Lars Kanis

unread,
Jan 4, 2026, 1:07:06 PM (7 days ago) Jan 4
to rubyin...@googlegroups.com
It seems like you installed the rubyinstaller for all users. This
disables some access to commonly used folders and you have to do
certain operations with admin permission. It is not recommended for a
single user installation. See
https://github.com/oneclick/rubyinstaller2/wiki/FAQ

In your case the installation of the libyaml MSYS2/MINGW package
failed due to missing permissions and so failed "bundle install".

It's best to uninstall ruby again and reinstall it for single-user.
This avoids the above issues.

Regards, Lars


Am So., 4. Jan. 2026 um 18:57 Uhr schrieb Asim Khan
<asim.asi...@gmail.com>:
> To view this discussion visit https://groups.google.com/d/msgid/rubyinstaller/58294375-cf76-4be5-9497-bae7859a59f0n%40googlegroups.com.

Asim Khan

unread,
Jan 5, 2026, 11:14:31 AM (6 days ago) Jan 5
to RubyInstaller
Hi, 

So I carried out some steps that made the gem installation possible. I first reset the bundler configuration using

bundle config unset deployment
bundle config unset system_bindir
bundle config --delete

Then to verify the reset, I applied the following command: bundle config list, which returns empty.

Then I rerun ruby installer devkit again using ridk install command (as an administrator), then used all options 1,2, and 3. Then update the bundler

gem update --system
gem cleanup

I was also facing the constant unable to lock database error during bundle install operation. Then as an administrator in Powershell I used the command:

Remove-Item -Force "C:\Ruby33-x64\msys64\var\lib\pacman\db.lck"

After that I installed the required YAML library using the command:

ridk exec pacman -S --needed mingw-w64-ucrt-x86_64-libyaml

I then ran the command bundle install and the gems were successfully installed.

Regards,
Asim 

Reply all
Reply to author
Forward
0 new messages