How do I install openssl for Ruby 1.9.3 - ruby

This is driving me crazy. Endless google searches yield zero help for what should be a simple task. I have a ruby script that requires the 'openssl' library, a script that was previously working before I upgraded my Ruby build to 2.2.2. This messed all my existing ruby stuff up, so I rolled back to my original version of 1.9.3, and openssl is now gone. I tried
gem install 'openssl'
and a bunch of other variations, but this simply throws the error
ERROR: Could not find a valid gem 'openssl' in any repository
Can anybody tell me how I can get openssl back in my Ruby installation?

I suggest trying ruby-build, which is a ruby installer.
Even if you don't plan to use it long-term, it's good about installing all the dependencies, such as SSL. If ruby-build succeeds for you, then you can look at its logs to see how it succeeded.

Ok, so my question was a silly one that didn't even make sense. Openssl wasn't the problem, and I was able to fix my own issue. If an admin could close or even delete this thread, that would probably be best for everybody.

Related

Can't find installed gems

I am very new to ruby, and am using Ubuntu , I installed ruby last week and have been using it ever since. But when I decided to start studying rails I realised the rails server will not start, I decided to reinstall ruby, and then rails, which I did successfully.
But now when I install a ruby gem, I do not see it, not even when I type gem list on the terminal, it also throws an error when I try to run it in a program. I am very frustrated and do not know what to do..
Try installing RVM instead of ruby directly, this will install the required setting and it will be easier to beginners.
https://rvm.io/rvm/install

`require': cannot load such file -- oauth

I was happily using Emacs's evernote-mode until stupidly removed OS X system ruby (I'm on Yosemite). Then I tried installing one via RVM (first tried 2.0 then 1.9), got all necessary gems, yet thing is still broken. Throws this message:
$HOME/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- oauth (LoadError)
from $HOME/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from $HOME/.rvm/rubies/ruby-1.9.3-p551/bin/enclient.rb:40:in `<main>'
Please help me to fix that
upd: I don't see the point of reinstalling system ruby (as people suggested) and then having it conflicting with those that I want to use via RVM. Ruby developers advise to use RVM. I symlinked my default Ruby to /usr/bin/ruby.
I seems that specific script uses something I don't have. I remember having hard time figuring out all dependencies and gems and installing them the first time I used that script and after hours of investigating it finally worked. But this time I got stuck.
I tried to run the script outside of Emacs and it runs with no errors (maybe that's not enough to find what's broken)
I tried to run irb and require modules one by one. It says => true until reaches require 'oauth/consumer'. I guess that's what's missing maybe? I run gem install oauth_consumer. It installed few gems, and now says => true for oauth/consumer in irb, the script though still doesn't work
i removed systems ruby once. i just had to go to the trash and put back everything i deleted and it worked for me. don't know how you "removed" your system ruby. besides, if you installed one with RVM then you have to tell RVM to choose and use/set a default ruby. because RVM won't install ruby 1.9.1 (rather a higher version which i think you did). So you have to set to that version.
Like this:
$ rvm --default use 2.1.5
don't forget to install oauth as well. Hope it helps.

How to install/use Ruby Shoes (without Hackety Hack)?

SOLUTION:
You have the same problem, you have to compile Shoes (https://github.com/shoes/shoes/wiki/Building-Shoes-on-Linux)
if rake doesn't work, try to install ruby 1.9.2 through rvm.
I recently started to learn Ruby, and i came across this library.
I tried to install it using the .run file provided by the official site, but it seems like it's broken. If i run it, it tells me:
./shoes-3.1.0.run: 1: eval: ./shoes: not found
And yes, after extracting the file, i found a folder which didnt contain it.
The only runnable thing i find is HacketyHack, which worked, but I prefer to use my own editor.
Since I have just started to learn Ruby, I'm not comfortable with playing with the .rb files to get it working outside of HH. I also tried to install it via apt-get, but after running 'shoes', all i get is:
no such file to load -- rubygems
Compiling from source code didn't work for me. Is there anything else I can try, or am I doing something terribly wrong?
The problem seems to be your ruby version. ruby in the apt repositories is version 1.8.7 which is quite old. Try apt-get install ruby1.9.1
If that doesn't work, I would recommend using rvm. Install, then simply rvm install ruby-2.0.0 which is the latest version, then rvm use 2.0.0. If shoes doesn't work under any of these versions, it's probably a bug in shoes.

Installing ruby gems fails when attempting to build native

So I decided that I was going to give Ruby (first 1.9.1, then 1.8.7) a try and I wanted to get the basic tools installed before I attempted to do too much.
I have begun to install some gems, and I have run into some issues when I attempt to install one which builds native code on windows 7.
I was attempting to install the ruby debugger and linecache and each time I get the following make error: make: *** No rule to make target %RUBY_HOME%/include/ruby-1.9.1/ruby.h', needed bytrace_nums.o'.
My google-fu has not turned up anything very useful, so I am asking for the SO community to point me in the right direction. When I go used Ruby 1.8.7, i only attempted to install ruby-debug and linecache. When I was using 1.9.1, I attempted to use ruby-debug19 and linecache19. Since the issue is the same for both versions, I assume that it is something wrong on my end, but I do not know where to start.
For some reason, I needed to run the gem install from a Unix shell emulator from the devkit.
I don't know why it worked out the way it did, but this how I fixed the problem.

Why is Phusion Passenger refusing to recognize my updated RubyGems?

I've updated RubyGems everywhere I can possibly think to update it:
The various places I've updated RubyGems http://files.droplr.com/files/14167865/zel8k.Screen%20shot%202010-03-09%20at%2017:24:59.png
but Phusion passenger keeps throwing the same error:
Error Screenshot http://files.droplr.com/files/14167865/zee8W.Screen%20shot%202010-03-09%20at%2017:19:50.png
There is that one freaking place that shows 1.3.1 as the version, despite the file name of 1.3.6. I've obviously borked things up pretty badly here.
That is, I need to update to 1.3.2 or greater and that I currently have 1.3.1.
Any idea how in the world I can get PP to use the correct version of RubyGems and preferably change things so I don't have to face this problem again?
Could this have anything to do with different paths for RubyGems and Ruby environments? These are my environments:
Environment screenshots http://files.droplr.com/files/14167865/zfH6x.Screen%20shot%202010-03-09%20at%2019:07:18.png
First, obtain the value of your PassengerRuby configuration. Then use that Ruby interpreter to run the following script:
http://pastie.org/862871
Like this:
/path-to-your-passenger-ruby-interpreter myscript.rb
and follow the instructions.
That might be of several reasons.
First, verify that you don't have it to explicitly require the rubygem in environment.rb. That is, if you have a line like this:
config.gem "ruby_gems", :version => "1.3.1"
Then you'll have to remove the version from it.
Also, seeing that the rubygems-update gives the incorrect version, you might want to uninstall it.
sudo gem uninstall rubygems-update
Since you have updated it, that gem is not necessary anymore.
I don't think it will help, but I would probably uninstall the macports version of rubygem as well since that might create collisions, even though it doesn't seem like it in this case.
Update:
Since you are using the Ruby from the operating system you don't have to install rubygem through macports at all.
To remove it:
sudo port uninstall rubygems
After that, make sure that you have upgraded the correct rubygem (the binary shows correct, but perhaps there is something missing)
sudo gem update --system
After you've done that. Open up irb (that is, irb and not the rails console) and check the following:
require 'rubygems'
puts Gem::RubyGemsVersion
Also, if you could paste how your apache/nginx configuration looks like, I doubt there is anything wrong in there, but you never know.

Resources