Ruby Gems Problem: uninitialized constant Gem::GemRunner - ruby

I had a rails 2.2 app running, when I tried to add the latest rspec plugin to it. I did that checking it from github with the script/plugin install command. That made some rake task to stop working, I googled for a while and found that I had to upgrade RubyGems. I did that and got the following error:
uninitialized constant Gem::GemRunner
It was a small and simple app under version control, so I erased everything, and apt-get remove ruby and rubygems, and reinstalled everything once again (doing apt-get install ruby, rubygems)
The problem it's still there, and I can't figure how to solve it. I'm quite new with Ubuntu, so maybe I'm not removing the packages really? (it takes very little time to execute the apt-get removes, so I'm not very confident)
What am I doing wrong? Is that a good way to do a 'clean start' (removing via apt and then reinstalling?)
PS: I've read that the problem is solved by modifiing framework.rb, but I cant find that file in the location that the author states...

I have a blog post that solves this issue.
It's because it's still trying to use the old gem executable, so you just symbolically link the new one (gem1.8) in place of the old one.

Related

El Capitan + Ruby/Brew/major issues

I've read a ton about how El Capitan's SIP messes up brew, ruby, and it's gems. The most recent thing I read is that brew was updated to better support El Capitan, so I followed a number of commands from an article online and apparently cleaned my whole system up and reinstalled all gems. Now, from terminal, everything works great. I don't have to write anything special to install gems... just gem install <name>.
However, SublimeText seems to be using a different Ruby. If I type which ruby, it shows as /usr/local/bin/ruby. But in SublimeText, it's showing this error about not finding the right gem (mechanize in this case): /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:inrequire': cannot load such file -- mechanize (LoadError)`
I tried creating a different build system file for Ruby, which points to ruby at /usr/local/bin/ruby, but it still shows this error (but below, it shows [cmd: ['/usr/local/bin/ruby']...
This has also caused me major issues trying to get the shoes gem to install.
Long question shortened: is there a definitive way to clear my system of all past brew, ruby, gems, etc etc, and redo it in a proper way that actually works for El Capitan?
Checkout #paskal answer here: Ruby 'require' error: cannot load such file
Try changing require <file name> with require "./<File name>".

Jekyll and Redcarpet (plus dependencies)

Up until a few hours ago, I had my jekyll install working as normal. Having created 26 different posts using my current setup, I'm not expecting something to suddenly not work at all. Ran jekyll build to see the results of a new post I created for my blog. I got an error saying it could not find redcarpet; weird since I have never touched my config or anything since I created it. I ran bundle install no new gems added. For sanity's sake I ran bundle show redcarpet, it could not be found. Okay that's weird. So I run gem install redcarpet v 3.1.0 which was the version I was using pretty much the entire time. I then run bundle install again, checking to see if redcarpet was added...and nope.
I decided to go into my config and switch markdown parser and add kramdown, then run jekyll serve...and now I get that I'm missing kramdown and like redcarpet even if I install via gem install jekyll refuses to acknowledge it's existence.
I tried deleting my gemfile and rebuilding it unfortunately that does nothing. If I run bundle exec jekyll serve it works however redcarpet isn't activated and thus the markdown isn't parsed correctly (And new entries aren't added to the index page).
I'm probably missing something obvious, any direction or advice would be much appreciated.

rbenv install fails because of ruby-lang.org layout change (or permanent failure?)

Of all the days I chose today to switch from rvm to rbenv. All went well far enough, there are good tutorials on this, but the fun stopped when I tried to install ruby 1.9.3.
rbenv install 1.9.3
proposed to install 1.9.3-p448 as the current version which seems ok to me, so I tried
rbenv install 1.9.3-p448
and went down from there on. It will look up something on ...cloudfront.net and then tried to fetch ruby-1.9.3-p448.tar.gz from the "usual location" which it considers to be
http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz
which fails with
/usr/local/bin/ruby-build: line 144: pushd: ruby-1.9.3-p448: No such file or directory
plus a final 404-error and a host of followup error messages.
As it turns out the link above is identical to the one published on http://www.ruby-lang.org/en/downloads/ which I would consider as "official" a link as you might find for Ruby. So if you go to ruby-lang.org manually (or using the link above) you will also find a broken download (as of 2013-08-06 17:06)!
I guess this is a temporary issue and the downloads will return (2.0.0 link is also broken by the way). Not to much of a problem for me at the moment as 1.9.2 can still be installed (and I am stuck with that at my current hosting provider ...), but anyways: Are there any other options I would have to install a ruby with rbenv without these "official" distributions?
Looks like ruby-lang.org has been going on and off line for a couple of hours now.
ruby-lang status: http://www.ruby-lang.org/en/news/2013/08/06/status-issue/
GitHub Issue: https://github.com/ruby/www.ruby-lang.org/issues/259
just tested overriding the mirror for ruby-build in cap...
rbenv uses ruby-build. You can override the mirror in ruby-build url in 2 ways:
Specifying a custom ruby version (requires you to write out a config in ruby-build/share/ruby-build/my-custom-ruby
Overriding the mirror url (requires the checksum to be the same), i.e., RUBY_BUILD_MIRROR_URL= http://mirrors.ibiblio.org/ruby/2.0/ruby-2.0.0-p247.tar.gz
env RUBY_BUILD_MIRROR_URL=http://mirrors.ibiblio.org/ruby/2.0/ruby-2.0.0-p247.tar.gz ~/.rbenv/bin/rbenv install 2.0.0-p247
I had this same problem, and I was able to work around it by editing the ruby-build recipe for the particular version of Ruby I needed to download.
I installed ruby-build as an rbenv plugin, so the recipe lives here:
~/.rbenv/plugins/ruby-build/share/ruby-build
Here's the edited version of the recipe:
install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz#36c852831d02cf90508c29852361d01b"
install_package "ruby-1.9.3-p448" "http://mirrors.ibiblio.org/ruby/1.9/ruby-1.9.3-p448.tar.gz#a893cff26bcf351b8975ebf2a63b1023"
#install_package "ruby-1.9.3-p448" "ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz#a893cff26bcf351b8975ebf2a63b1023"
I did not try this, but you might be able to achieve a similar result by following the instructions for specifying package download mirrors.

installing Ruby rails, Could not locate gemfile

I'm trying to Learn ruby atm. am having alot of problems installing ruby on rails on my computer. I'm Using the one click installer and this how to install tutorial.http://www.hashemzahran.com/riding-the-rails-installing-ruby-on-rails/
My first problem i ran into was that it couldn't find the lib file. so i created and a new lib folder and believe i corrected that problem
now though when i try to run bundle install i get the error "Could not locate gemfile" i found I've been checking around through Google but have not been able to find an answer to the question. I'm running Windows 7 if that matters.
thanks for any help you can give me. I'm completely new to this.
install through this guide..
ruby on rails
try to install ruby-1.9.2-p180

Using curb gem and libcurl on Windows

I am trying to install the curb gem, which is libcurl bindings for Ruby, and of course I need to have "A working (lib)curl installation, with development stuff" installed on my computer. So, I went to the cURL Download Wizard and downloaded this package.
But adding the bin into my PATH does not produce improvement and I still get an error when I try to install the curb gem, such as:
extconf.rb:19: Can't find libcurl or curl/curl.h
(RuntimeError)
Even though, curl is already in the PATH.
EDIT: I also tried raking the gem, as per the instructions. It fails saying "make failed" and throwing a bunch of errors like this:
C:/Ruby/lib/ruby/gems/1.8/gems/curb-0.7.7.1/ext/curb_postfield.c:76:
undefined reference to
`_imp__curl_formadd'
Execute Below command for windows only and its works
gem install curb --platform=mswin32
I realise this is a very old question, but I had this exact problem today and found the instructions on someone else's site. These worked for me so I thought I would share them since people with this issue are most likely to come across StackOverflow first: http://jes.al/2012/10/installing-curb-gem-on-windows-7/
In a nutshell:
Get the 32-bit development version of curl (see my notes below)
Add the curl bin directory to your PATH
Run the following command (replacing the paths to curl as necessary)
gem install curb --platform=ruby -- -- --with-curl-lib="C:/curl-7.27.0-devel-mingw32/bin" --with-curl-include="C:/curl-7.27.0-devel-mingw32/include"
A couple of personal notes:
Even though I am on 64-bit Windows 7, I had to download the 32-bit libcurl version under "Win32 - Generic", identified as "Win32 2000/XP zip".
I got the error c:/Ruby193/lib/ruby/1.9.1/mkmf.rb:246:in 'initialize': Permission denied - mkmftmp1.log (Errno::EACCES) while installing the gem. This rather messed up page here suggested that it might be a problem with my anti-virus, and that just retrying a couple of times might work, and indeed, it did.

Resources