How do I specify which gem to use when using rbenv. Multiple versions same gem installed

StackOverflow https://stackoverflow.com/questions/22122159

  •  18-10-2022
  •  | 
  •  

문제

I've been using Sass 3.2.13.

I want to try out the sourcemap generation in 3.3, so I installed 3.3.

'gem list | grep sass' returns

sass (3.3.0.rc.5, 3.2.14)

I would like to invoke sass 3.3 from the commandline. I'm not using sass from a within a ruby project.

I discovered that format should work:

gem_name __versionNum__ --opts

So, I've tried this:

sass _3.3.0.rc.5_ --watch --sourcemap sass/site.sass: css/site2.css

The resulting stack trace returns

"Could not find sass (= 3.3.0.rc.5)..."

I've tried variations, like 3.3.0, 3.3, but these return stack traces with the same message about not being able to find the specified version.

도움이 되었습니까?

해결책

Turns out that I was calling the wrong 'sass' binary.

Instead of using my rbenv gem, I was using 'sass' from '/usr/local/bin'.

I've deleted system sass. Now when I call 'sass' I get the version offered by the gem I installed via rbenv.

Yes, I know I shouldn't be deleting system binaries. It's a dirty, dirty thing to do. In the desperate case of removing system ruby from ubuntu, I think the measure is justifiable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top