Installing Gems without rvm, as root, with explicit version of ruby
Asked Answered
M

3

0

I've decided to get rid of rvm, and I'm having trouble compiling a gem with my new version of ruby 1.9.2. The gem requires 1.9.2, I have it, yet says it can't install without, so the error messages makes no sense.

How can I explicitly tell the gem to compile with said version of ruby?

Gem::InstallError: linecache19 requires Ruby version >= 1.9.2.
An error occured while installing linecache19 (0.5.12), and Bundler cannot continue.
Make sure that `gem install linecache19 -v '0.5.12'` succeeds before bundling.
 apps2 ~/projects/sms/apps2/apps2_admin $ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.8.0]
 apps2 ~/projects/sms/apps2/apps2_admin $ which ruby
/usr/local/bin/ruby
Mayramays answered 9/10, 2011 at 1:18 Comment(0)
A
2

I had the same issue (linecache19 hangs forever/indefinitely) when using rbenv on OS X Lion. I found the solution was to install Ruby with OpenSSL option, like this:

rbenv install 1.9.2-p290 --with-openssl-dir=/usr/local
rbenv rehash
rbenv global 1.9.2-p290

Now, you can run or bundle this and it'll install fine:

gem install ruby-debug19

Hope that helps someone.

Abominate answered 6/11, 2011 at 13:15 Comment(1)
Worked for me to get past a bundle failure. Thanks!Mediatorial
S
7

I had a similar issue and traced back the issue and solved it as follows:

The root of the issue is that in the gem installer.rb file the passed required ruby version from linecache19 is 1.9.2 while the Gem.ruby_version is something like 1.9.2.dev.30909, and ("1.9.2" >= "1.9.2.dev.30909") is false.

so first become sure that ruby version is 1.9.2:

ruby -v

then manually use --force to bypass version check:

gem install ruby_core_source
gem install linecache19 --force

if you faced with another error starting with following lines:

checking for vm_core.h... no
*** extconf.rb failed ***

You have to explicitly set the source path to vm_core.h

In my case:

$ which ruby
/Users/Reza/.rvm/rubies/ruby-1.9.2-rc2/bin/ruby
$ echo $rvm_path
/Users/Reza/.rvm/

so to install linecache19 :

gem install ruby_core_source
gem install linecache19 --force -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-rc2/

ruby-debug19 has a similar issue:

gem install ruby-debug19 --force -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-rc2/

That's all!

Spoonfeed answered 16/10, 2011 at 0:17 Comment(0)
A
2

I had the same issue (linecache19 hangs forever/indefinitely) when using rbenv on OS X Lion. I found the solution was to install Ruby with OpenSSL option, like this:

rbenv install 1.9.2-p290 --with-openssl-dir=/usr/local
rbenv rehash
rbenv global 1.9.2-p290

Now, you can run or bundle this and it'll install fine:

gem install ruby-debug19

Hope that helps someone.

Abominate answered 6/11, 2011 at 13:15 Comment(1)
Worked for me to get past a bundle failure. Thanks!Mediatorial
J
0

This is what worked on Ubuntu:

I had the same problems and tried so many options before I came across this: http://beginrescueend.com/packages/openssl/

$ rvm pkg install openssl
$ rvm remove 1.9.2
$ rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr

This resolves the issue with linecache19 rubydebug-19 and openssl:

*** extconf.rb failed ***
custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)

then you can do

gem install ruby-debug19
Jugglery answered 27/11, 2011 at 0:22 Comment(1)
Be careful when posting copy and paste boilerplate/verbatim answers to multiple questions, these tend to be flagged as "spammy" by the community. If you're doing this then it usually means the questions are duplicates so flag them as such instead.Tetryl

© 2022 - 2024 — McMap. All rights reserved.