Code Monkey home page Code Monkey logo

Comments (16)

lasseebert avatar lasseebert commented on August 16, 2024 6

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.

davelnewton avatar davelnewton commented on August 16, 2024 3

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.

romenigld avatar romenigld commented on August 16, 2024 1

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.

rstacruz avatar rstacruz commented on August 16, 2024

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.

HashNuke avatar HashNuke commented on August 16, 2024

@rstacruz Will check this out in the next few hours.

from asdf-ruby.

HashNuke avatar HashNuke commented on August 16, 2024

@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.

rstacruz avatar rstacruz commented on August 16, 2024

Hmm.. Huh. Wonder why this worked on rbenv then.

from asdf-ruby.

HashNuke avatar HashNuke commented on August 16, 2024

@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.

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.

HashNuke avatar HashNuke commented on August 16, 2024

Haha. I just read my own comment on the top of the rubygem hooks file.

from asdf-ruby.

rstacruz avatar rstacruz commented on August 16, 2024

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.

rstacruz avatar rstacruz commented on August 16, 2024

how can we help?

from asdf-ruby.

HashNuke avatar HashNuke commented on August 16, 2024

@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.

lucaspiller avatar lucaspiller commented on August 16, 2024

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.

rstacruz avatar rstacruz commented on August 16, 2024

Well if you guys say it's closed then I trust you :)

from asdf-ruby.

HashNuke avatar HashNuke commented on August 16, 2024

@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.

Stratus3D avatar Stratus3D commented on August 16, 2024

Closing as I don't think this is a bug anymore.

from asdf-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.