rvm and octopress cannot generate gists and pictures under mac - ruby

Since I installed octopress I can not run rake generate for posts that include pictures, code or other media. I get all kind of errors.
I'm using rvm's ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.0.0] under Mountain Lion. As a package manager I use MacPorts. Is there anything I need to install or that I can do to fix this? It's getting really annoying... :-(
Thanks in advance, right bellow you can see the log here. I wasn't able to post it on stackoverflow.
Thanks in advance for your time!

It looks like you used clang for compiling ruby, this is not fully supported. There is at least one known bug with Fibers, and others problems might happen depending on clang version.
Ruby should be compiled with GNU GCC - you can find instructions how to get it by reading output of:
rvm requirements
There is also slightly chance this could be OpenSSL related, make sure you have only one version of it installed and used, sometimes reinstalling it with RVM could help:
rvm pkg install openssl
rvm reinstall 1.9.3

Related

Ruby RVM issues

So I think* RVM may be keeping my Ruby version back artificially. I am getting all sorts of errors in Rails. So I checked the Ruby version I was using. Said it was back a few versions.. so I tried updating to 2.5.0. System said 2.5.0 was already installed? So I checked ruby -v, and got 2.3.3
Here is exactly what my system is telling me:
Johns-MacBook-Pro:PLAYGROUND johnseabolt$ brew install ruby
Warning: ruby 2.5.0_2 is already installed
Johns-MacBook-Pro:PLAYGROUND johnseabolt$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]
Johns-MacBook-Pro:PLAYGROUND johnseabolt$
I thought it was an RVM issue maybe? But when I tried to use 2.5.0, I got this:
Johns-MacBook-Pro:PLAYGROUND johnseabolt$ rvm use 2.5.0_2
Required ruby-2.5.0_2 is not installed.
To install do: 'rvm install "ruby-2.5.0"'
Any ideas what is going on? It's a bit of a pain.
This is the relevant line of output:
To install do: 'rvm install "ruby-2.5.0"'
what happens when you run that line of code? It should fix all your problems... :)
I'm not sure what you're saying your problem is exactly, but you can and will have multiple versions of Ruby installed in various places on a modern system. Different applications will require different versions.
In terms of being held back, Ruby doesn't autoupdate like browsers, it's up to you to install the ones you want.
It looks like you have at least one Ruby installed with RVM, and you may have installed with Brew too (which I didn't you know you could do, but I would recommend not to do)
which ruby will tell you which Ruby is loaded in a new shell. It should be in an RVM bin.

Did ruby install wrong?

I followed 2 different guides to install ruby on OSX and I think I messed some things up. Now that I know what I'm doing a bit more I have a feeling something is wrong. I'd like to 'start fresh' but i dont know what to remove safely (I dont mind re-installing everything. I have nothing super important)
I first used rvm and then decided i wanted to use homebrew. I uninstalled rails with rvm and then 'imploded' rvm. I then installed homebrew and then brew install rails 1.9.3
Although... when i run gem install xxx, all my gems seem to be in a weird path?
For instance, sinatra.rb is installed here:
/usr/local/lib/ruby/gems/1.9.1/gems/sinatra-1.3.1/lib
Notice it says 1.9.1, yet when I run
ruby -v
I get 1.9.3p0
and which ruby i get this
/usr/local/Cellar/ruby/1.9.3-p0/bin/ruby
If i do which [rails,git,mysql,whatever]
they all seem to point to Cellar.
as a sidenote, i have two versions of sinatra.rb on my computer... this is where the other one is (although the one I'm pretty sure it's not using).
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/sinatra-1.2.0/lib
kind of ridiculous...
I'm not sure whats going on here.
This is my path if that helps:
export LSCOLORS="GxGxBxDxCxEgEdxbxgxcxd"
export CLICOLOR=1
export PATH=/usr/local/Cellar/ruby/1.9.3-p0/bin:/usr/local/mysql-5.5.18-osx10.6-x86_64/bin:/usr/local/bin:$PATH
That's fine. You are using 1.9.3. The gems are installed under a 1.9.1 directory, to distinguish them from gems installed for 1.8.7 (some gems that work with the 1.9 series don't with 1.8, and vice-versa). 1.9.1 was the first released version of the 1.9 series.

The RVM is not working for me

I'm trying to use RVM to install ruby 1.9.2 on a Lion system with xcode 4.2. I'm new to ruby so I don't understand why this is not working. I'm reading Ruby on Rails 3 Tutorial as my install guide. However, book is not up to date as it relates to Lion. Can anyone point out what's going on and give exact instructions on what I need to do?
If you do a fresh install of Xcode 4.2, it does not come with GCC (it only comes with LLVM GCC). You should download: https://github.com/kennethreitz/osx-gcc-installer to get GCC.
Once Xcode is installed:
Install RVM (http://beginrescueend.com/rvm/install/)
Close terminal, open a new terminal (just in case).
Enter: rvm list known
You can install any of the rubys with: rvm install X (where X is the ruby)
If you're not sure about step 4, just do "rvm install ruby-1.9.2"
I think that'll work...
I don't have that book, but try following the official instructions: http://beginrescueend.com/rvm/install
EDIT: Tried to leave this as a comment to Ngan, but don't know how to format in comments. If that is indeed the issue (you'll know because you will be getting segfaults when you install gems), Xcode still comes with plain gcc, it just uses LLVM GCC by default. You can set the environment variable CC to use plain gcc:
rvm remove 1.8.7 # or whatever version is failing, just in case
CC=/usr/bin/gcc-4.2 rvm install 1.8.7
If you don't mind using homebrew, try this instructions: Installing Rails on OS X Lion with HomeBrew, RVM and Mysql

ruby 1.9.0 on debian... good choice?

I have setup a debian box from scratch and installed ruby1.9 (the one in the repos). I though ruby 1.9.2 would be installed but it was 1.9.0
Well, I keep on with this guy and installed several gems (dm-core among them).
Now, I'm thinking about getting rid of ruby 1.9.0 and install 1.9.2 instead. What is the best and cleanest way to do this kwnowing I'm running debian 5 ?
Will I need to re-installed all the gems ?
RVM is by far the best way to do this. See the excellent instructions here
With RVM I can use multiple installs of Ruby and associated gems in a very effective and easy to use Sandbox. One feature which you may or may not appreciate is that it breaks the link with apt, compiling the source as it requires. I'm using it on Ubuntu 10.10

How to update Ruby to 1.9.x on Mac?

I have created a new user account on my mac and I am trying to update to the current version of ruby on it (1.9.2) from the snow leopard default of 1.8.7. Can somebody point me to tutorial or explain the best method to update Ruby on my mac from 1.8 to 1.9.2? Thanks
As The Tin Man suggests (above) RVM (Ruby Version Manager) is the Standard for upgrading your Ruby installation on OSX: https://rvm.io
To get started, open a Terminal Window and issue the following command:
\curl -L https://get.rvm.io | bash -s stable --ruby
( you will need to trust the RVM Dev Team that the command is not malicious - if you're a paranoid penguin like me, you can always go read the source: https://github.com/wayneeseguin/rvm ) When it's complete you need to restart the terminal to get the rvm command working.
rvm list known
( shows you the latest available versions of Ruby )
rvm install ruby-2.3.1
For a specific version, followed by
rvm use ruby-2.3.1
or if you just want the latest (current) version:
rvm install current && rvm use current
( installs the current stable release - at time of writing ruby-2.3.1 - please update this wiki when new versions released )
Note on Compiling Ruby: In my case I also had to install Homebrew Link to get the gems I needed (RSpec) which in turn forces you to install Xcode (if you haven't already) https://itunes.apple.com/us/app/xcode/id497799835 AND/OR install the GCC package from: https://github.com/kennethreitz/osx-gcc-installer to avoid errors running "make".
Edit: As of Mavericks you can choose to install only the Xcode command line tools instead of the whole Xcode package, which comes with gcc and lots of other things you might need for building packages. It can be installed by running xcode-select --install and following the on-screen prompt.
Examples: https://rvm.io/workflow/examples/
Screencast: http://screencasts.org/episodes/how-to-use-rvm
Note on erros: if you get the error "RVM is not a function" while trying this command,
visit: How do I change my Ruby version using RVM? for the solution.
I'll make a strong suggestion for rvm.
It's a great way to manage multiple Rubies and gems sets without colliding with the system version.
I'll add that now (4/2/2013), I use rbenv a lot, because my needs are simple. RVM is great, but it's got a lot of capability I never need, so I have it on some machines and rbenv on my desktop and laptop. It's worth checking out both and seeing which works best for your needs.
With brew this is a one-liner:
(assuming that you have tapped homebrew/versions, which can be done by running brew tap homebrew/versions)
brew install ruby193
Worked out of the box for me on OS X 10.8.4. Or if you want 2.0, you just brew install ruby
More generally, brew search ruby shows you the different repos available, and if you want to get really specific you can use brew versions ruby and checkout a specific version instead.
I know it's an older post, but i wanna add some extra informations about that.
Firstly, i think that rvm does great BUT it wasn't updating ruby from my system (MAC OS Yosemite).
What rvmwas doing : installing to another location and setting up the path there to my environment variable ... And i was kinda bored, because i had two ruby now on my system.
So to fix that, i uninstalled the rvm, then used the Homebrew package manager available here and installed ruby throw terminal command by doing brew install ruby.
And then, everything was working perfectly !
The ruby from my system was updated !
Hope it will help for the next adventurers !
I'll disagree with The Tin Man here. I regard rbenv as preferable to RVM. rbenv doesn't interfere drastically with your shell the way RVM does, and it lets you add separate Ruby installations in ordinary folders that you can examine directly. It allows you to compile Ruby yourself. Good outline of the differences here: https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F
I provide instructions for compiling Ruby 1.9 for rbenv here. Further, more detailed information here. I have used this technique with easy success on Snow Leopard, Lion, and Mountain Lion.
Dan Benjamin's Hivelogic article Installing Ruby, RubyGems, and Rails on Snow Leopard is the recommended place to go although the article is for 1.8, so here's a Ruby 1.9-specific install on Snow Leopard. Watch out for the 64-bit thing... either go all 64-bit 'fat' (as is - for example - Apache on OS X, which can cause problems with 32-bit libraries) or check any gems you're likely to use to make sure they're okay for 64-bit.
This command actually works
\curl -L https://get.rvm.io | bash -s stable --ruby
As previously mentioned, the bundler version may be too high for your version of rails.
I ran into the same problem using Rails 3.0.1 which requires Bundler v1.0.0 - v1.0.22
Check your bundler version using: gem list bundler
If your bundler version is not within the appropriate range, I found this solution to work: rvm #global do gem uninstall bundler
Note: rvm is required for this solution... another case for why you should be using rvm in the first place.
There are several other version managers to consider, see for a few examples and one that's not listed there that I'll be giving a try soon is ch-ruby. I tried rbenv but had too many problems with it. RVM is my mainstay, though it sometimes has the odd problem (hence my wish to try ch-ruby when I get a chance). I wouldn't touch the system Ruby, as other things may rely on it.
I should add I've also compiled my own Ruby several times, and using the Hivelogic article (as Dave Everitt has suggested) is a good idea if you take that route.

Resources