Comments (16)
For the record: I had a similar issue for another reason: I previously used rbenv, but after changing to asdf bundle exec rspec
gave the same error message as above.
Turned out I had some rbenv leftovers in ~/.gem/
. Deleting that folder and reinstalling the gems fixed my issue.
from asdf-ruby.
FWIW, I had this same problem. asdf reshim ruby
or the version-specific didn't help. I had to rehash
at the zsh
level then all was good.
from asdf-ruby.
before I needed to use:
bundle exec rspec spec
but after I do a:
asdf reshim ruby
and now I just put:
rspec
and work's!
from asdf-ruby.
It's looking for /Users/rsc/.asdf/installs/ruby/2.3.0/bin/rails
which doesn't exist. I tried gem install rails
and asdf reshim ruby 2.3.0
.
from asdf-ruby.
@rstacruz Will check this out in the next few hours.
from asdf-ruby.
@rstacruz I just checked the rubygems hook. To my surprise: rails
executable is not a part of the rails
gem. It's part of the railties
gem. https://github.com/rails/rails/blob/master/railties/railties.gemspec#L22
To reproduce: I uninstalled my rails
and also railties
gems. Then did gem install rails
. Which resulted in installing railties
as a dependency (resulting in the shim getting created).
I've attached my console output. Closing issue for now. But do let me know if installing railties actually did not create the rails shim (that's an issue).
~/projects/test-app
★ gem uninstall railties
You have requested to uninstall the gem:
railties-4.2.5.1
coffee-rails-4.1.1 depends on railties (< 5.1.x, >= 4.0.0)
ember-rails-0.19.3 depends on railties (>= 3.1)
jquery-rails-4.1.0 depends on railties (>= 4.2.0)
rails-4.2.5.1 depends on railties (= 4.2.5.1)
sass-rails-5.0.4 depends on railties (< 5.0, >= 4.0.0)
sprockets-rails-3.0.1 depends on railties (>= 4.0, development)
sprockets-rails-3.0.0 depends on railties (>= 4.0, development)
web-console-2.3.0 depends on railties (>= 4.0)
web-console-2.2.1 depends on railties (>= 4.0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Remove executables:
rails
in addition to the gem? [Yn] y
Removing rails
Successfully uninstalled railties-4.2.5.1
~/projects/test-app
★ gem uninstall rails
Successfully uninstalled rails-4.2.5.1
~/projects/test-app
★ which rails
/Users/HashNuke/.asdf/shims/rails
~/projects/test-app
★ rails --version
No such command in 2.3.0 of ruby
~/projects/test-app
★ rm `which rails`
~/projects/test-app
★ gem install rails
Fetching: railties-4.2.5.1.gem (100%)
Successfully installed railties-4.2.5.1
Fetching: rails-4.2.5.1.gem (100%)
Successfully installed rails-4.2.5.1
2 gems installed
~/projects/test-app
★ which rails
/Users/HashNuke/.asdf/shims/rails
~/projects/test-app
★ rails --version
Rails 4.2.5.1
from asdf-ruby.
Hmm.. Huh. Wonder why this worked on rbenv then.
from asdf-ruby.
@rstacruz Ah just checked. It's because we run reshim only for the gem that's being installed.
We have the exact same hook as rbenv. So it was easier to spot the difference.
- https://github.com/rbenv/rbenv/blob/master/rbenv.d/exec/gem-rehash/rubygems_plugin.rb#L1-L11
- https://github.com/HashNuke/asdf-ruby/blob/master/rubygems-plugin/rubygems_plugin.rb#L7
Thanks for pointing out. We could rehash everything. I didn't choose that because that might be slow. Looks like we have to make that change. I'll reopen the issue.
from asdf-ruby.
Haha. I just read my own comment on the top of the rubygem hooks file.
from asdf-ruby.
Haha. This is familiar.
On Tuesday, February 16, 2016, Akash Manohar [email protected]
wrote:
Haha. Just read my own comment on the top of the rubygem hooks file.
—
Reply to this email directly or view it on GitHub
#8 (comment).
from asdf-ruby.
how can we help?
from asdf-ruby.
@rstacruz the asdf reshim <plugin>
needs to be implemented here https://github.com/HashNuke/asdf/blob/master/lib/commands/reshim.sh
I'm open to anyone picking it up. Or I'll do it this weekend.
Sadly we don't have tests yet. If tests are in, then we could make changes with courage & faster.
from asdf-ruby.
After installing a fresh Ruby, and all the gems from scratch ($ bundle install
) this seems to work now:
$ which rails
/Users/luca/.asdf/shims/rails
$ which ruby
/Users/luca/.asdf/shims/ruby
$ rails --version
Rails 4.2.6
$ bundle exec rails --version
Rails 4.2.6
@rstacruz Can you see if you can repeat it?
from asdf-ruby.
Well if you guys say it's closed then I trust you :)
from asdf-ruby.
@lucaspiller This is a bug. Cannot remember more details, but I'm pretty sure my previous comment about having to implement asdf reshim <plugin>
is a requirement.
@rstacruz No AFAIK it's not done :)
from asdf-ruby.
Closing as I don't think this is a bug anymore.
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
- asdf does not seem to be picking up on ruby gem executables in the GEM_PATH HOT 7
- "Downloaded files will not be preserved." HOT 1
- Ruby 3.2.3 cannot be installed on Ubuntu 22.04 HOT 2
- 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.