Comments (7)
Right, I'm used to chruby
, and I have minor versions in my ~/.gem/ruby
folder. But asdf behaves differently. Out of curiosity, I switched to asdf (which my Ruby on Mac product makes super easy; shameless plug), and I was not able to reproduce your issue. Here's what I did:
rom config set manager asdf
rom install ruby 3.2.1
cd ~/projects
mkdir rails-test
cd rails-test
rails new .
This used 3.2.3 by default, so then I updated the ~/.ruby-version
and Gemfile
to point to Ruby 3.2.1, and then:
bundle install
bundle add rspec-core
command -v rspec
/Users/moncefb/.asdf/shims/rspec
bundle exec rspec
No examples found.
Finished in 0.00025 seconds (files took 0.20698 seconds to load)
0 examples, 0 failures
bundle info rspec-core | grep Path
Path: /Users/moncefb/.asdf/installs/ruby/3.2.1/lib/ruby/gems/3.2.0/gems/rspec-core-3.12.2
So, it sounds like something in your dev setup is putting the gem path ~/.gem/ruby
before the asdf
path.
When I run gem env
, I get this order:
- GEM PATHS:
- /Users/moncefb/.asdf/installs/ruby/3.2.1/lib/ruby/gems/3.2.0
- /Users/moncefb/.gem/ruby/3.2.0
and the installation directory also points to asdf:
RubyGems Environment:
- RUBYGEMS VERSION: 3.5.5
- RUBY VERSION: 3.2.1 (2023-02-08 patchlevel 31) [arm64-darwin23]
- INSTALLATION DIRECTORY: /Users/moncefb/.asdf/installs/ruby/3.2.1/lib/ruby/gems/3.2.0
Here's what I would try:
• Check your .zshrc, .zprofile, .zlogin for anything that might affect your PATH
• Update to the latest bundler and Rubygems
• Backup and remove (or temporarily rename) your ~/.bundle/config
from asdf-ruby.
This seems to be the issue:
% bundle info rspec-core | grep Path
Path: /Users/jed/.gem/ruby/3.2.0/gems/rspec-core-3.12.2
It looks like you have rspec-core installed in 3.2.0, but not in 3.2.1. Are you sure your project's .ruby-version
and Gemfile
are specifying 3.2.1? Perhaps you haven't yet run bundle install
while using Ruby 3.2.1?
from asdf-ruby.
Thank you for the quick reply.
I thought similar at first, but it was brought to my attention that this expected behavior because 3.2 is the ABI version for 3.2.1? That seems logical to me, but I don't know how to verify that easily. Some other supporting evidence:
I generated a binstub with bundler bundle binstub rspec
and then rspec was able to be run with the binstub.
I only have one ruby installed
bundle install
ran cleanly and should have installed that gem to that directory but my .gem
dir contains no minor versions:
% ls /Users/jed/.gem/ruby/
2.6.0 3.2.0 3.3.0
.tool_versions
terraform 1.3.7
python 3.10.11
ruby 3.2.1
head of Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "~> 3.2.1"
Gemfile.lock
exerts.
PLATFORMS
arm64-darwin-21
ruby
x86_64-linux
RUBY VERSION
ruby 3.2.1p31
BUNDLED WITH
2.4.21
No legacy .ruby_version
file in the project or in the parent file hierarchy, at least up to $HOME
.
from asdf-ruby.
One other item of note, this did seem to start after a brew update/upgrade and an associated ruby plugin update sadly I did not track the changes too closely but it was probably related to updating the ruby versions available so I could get the 3.3.0 releases and to ensure my statically linked libs were up to date to build the new ruby version.
from asdf-ruby.
Looking at #378 I'm wondering if this is an issue because rspec-core does not use the bin directory for executables.
EDIT: there is a bindir
setting for rspec-core, so still searching for the way in which asdf should dynamically switch to gem executables per ruby version.
from asdf-ruby.
I should have specified that it's probably the GEM_PATH and/or GEM_HOME env vars that are possibly being set somewhere. You can check with env | grep GEM
. Also, are you perhaps specifying --user-install
in your ~/.gemrc
?
from asdf-ruby.
I've run into the similar issue: binaries from gems installed from git repo in Gemfile do not work. Looks like an old issue #194, but I did not understand the solution from there.
from asdf-ruby.
Related Issues (20)
- Can't install truffleruby+graalvm on AlpineLinux HOT 1
- Failed to install Ruby 3.1.4 on Ubuntu 22.04
- Issue installing ruby 3.2.X HOT 1
- Failed to install ruby 3.2.1 on M1 Pro with macOS Ventura 13.3 and macOS 14.0
- Observe ASDF_CONCURRENCY HOT 3
- rbenv install faild with whitespace in `$ASDF_DATA_DIR`
- Getting BUILD FAILED (macOS 13.2.1 on arm64 using ruby-build 20231114) using M2 Macbook on Ventura 13.2.1 HOT 2
- Failed to upgrade Ruby version from 3.2.2 to 3.3.0 using asdf HOT 2
- build fail for ruby 3.3.0 on Apple M2 Max silicone and sonoma 14.2.1 (23C71) HOT 2
- Add Ruby 3.2.3 HOT 2
- "Downloaded files will not be preserved." HOT 1
- Ruby 3.2.3 cannot be installed on Ubuntu 22.04 HOT 1
- Build failed: `psych` Could not be configured. It will not be installed. HOT 3
- Truffle Ruby Latest? HOT 1
- The same OS and asdf version on 2 different machines shows different recent ruby versions to install HOT 4
- asdf in background HOT 4
- Question: can the same version be installed twice with diff name? HOT 3
- Auto-reshim is broken when using the asdf-alias plugin
- Failed to install ruby 3.1.5 on Mac OS 13.6.6 M2 Pro
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asdf-ruby.