Using RubyMine as my IDE for ruby development with chef on a mbp running OSX 10.8.4
Chef requires ruby 1.9 ruby, and I have it installed. When querying the ruby version via terminal it does shows : ruby 1.9.3p429 . However, when trying to use it with RubyMine, it shows (Under preferences->SDKs) only 1.8.3, not seeing or allowing me to change to 1.9.x
Any help greatly appreciated!.
Thank you.
So apparently version 1.8.3 is installed at /usr/bin/ruby. How did you install 1.9?
If you are using RVM then your ruby installations are probably at ~/.rvm/rubies/ instead. Or if you're using rbenv, ruby might be at ~/.rbenv. Although RubyMine should detect the default location for rvm and rbenv. Do you have ruby in another location? Maybe check with sudo find -name ruby in the terminal to look for other locations of ruby.
Related
I am about to install a newer version of Ruby so I checked the following things-
Which ruby
/Applications/MAMP/Library/bin//ruby
ruby - v
2.6
I don't like to use Mamp ruby as I want to use a newer version of Ruby probably 2.7(as it supports the application)
Also when I do which ruby it doesn't show Mac ruby version.
Is it ok if I install a ruby version manager like chruby. Would it interfere with any other version.
Any help is highly appreciated.
Thank you.
Is Ruby 1.9.3 supported on Mac OS? Or should I stick to 1.8.7? I am new to OS X and am setting up my Ruby development environment.
Technically speaking, no. So I'm +1ing your question which currently has two downvotes.
According to the Ruby's wiki page on Supported Platforms, OS X is not "Supported", but is merely "Best Effort" for both Ruby 1.9.3, and Ruby 1.9.1. Ruby 1.9.3 has no "Supported" platforms, and Ruby 1.9.1 only has Debian GNU/Linux 4.0 on IA32 supported.
However, Ruby 1.8.7 will soon reach its end of life as far as the MRI Ruby team is concerned, and I wouldn't count on Apple doing much maintenance of Ruby 1.8.7. So use 1.9.3 anyway.
Yes.
You can install it from source or with Homebrew, or use rbenv or RVM to manage multiple Ruby versions.
I upvoted as well. This is a good question.
I run Ruby 1.9.3 for almost all my development work. I'd highly recommend using it.
Ruby 1.8.7 is older, slower and is running out of time for support.
I'd also recommend doing all installation of Ruby on your machine using RVM (The Ruby Version Manager). Here's the link to install it:
https://rvm.io//rvm/install/
Once you have RVM installed (the steps on its web page are good), then type the following to install Ruby 1.9.3:
rvm install ruby-1.9.3-p125
This will bring the latest version of Ruby 1.9.3 down and install it on your machine for you.
I am using Ruby on Rails 3.2.2 and RVM (Ruby Version Manager). By using RVM I installed 2 Ruby versions: first 1.9.3 and then 1.9.2. After I run the rvm use --default 1.9.2 command line I closed and reopened the Terminal window. Finally I run the following command lines in the Terminal window:
$ which ruby
/<MY_USER_PATH>/.rvm/rubies/ruby-1.9.2-p318/bin/ruby
$ ruby -v
ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-darwin10.8.0]
However, if I add the <%= "Ruby version #{RUBY_VERSION}" %> code in a view file of my Ruby on Rails project I get Ruby version 1.9.3.
Why my Ruby on Rails project is still running with the Ruby version 1.9.3? How can I make that to run in Ruby 1.9.2?
Passenger doesn't care about RVM, you need to compile Passenger with the Ruby version you want to use, and follow its instructions to setup Apache's configuration accordingly.
If you want to switch Ruby versions, you need to reinstall Passenger's Apache module via passenger-install-apache-module and follow the instructions.
You will likely see that the PassengerRuby directive in your Apache config is pointing to a specific ruby.
If you need different Ruby versions with Passenger, Phusion's blog post on this may be helpful. RVM's docs on Passenger integration are worth reading as well.
I would guess that Apache (Passenger?) is using your globally installed version of Ruby, which looks like ruby 1.9.2. Do a sudo su and then try which ruby and see if you're still pointing to the RVM version of ruby. That version of Ruby is the one that Apache is using, you'd have to setup ruby globally to allow Apache (Passenger) to use it.
I am trying to setup Ruby 1.9.2-p180 on my system for project specific purposes. I already have Ruby 1.9.2-p134 and Ruby 1.8.7 with me.
Do I need to replace Ruby 1.9.2-p134 with Ruby 1.9.2-p180 or can both co exist?
I'm making use of Ubuntu 10.04 OS.
Thank you..
That's exactly what RVM is for.
rvm install 1.9.2-p180
Then to use it…
rvm use 1.9.2-p180
You can also use .rvmrc to configure projects per-directory and set the rvm default to whichever you prefer.
To list installed Ruby versions…
rvm list
:)
I'm working on a project that i have to use ruby 1.8.7. I'm using today, ruby 1.8.6 + Mac OSX Darwin. This ruby 1.8.6 was installed with the OS, it's a developer package from Apple. My question is: how can i update this package? if i run ports, it dont find my current installed package and install a new ruby version, with different paths and as effect it breaks my rubygems (i know how to fix it, but it is always workarounds over workarounds).
There is a clean way to update the default ruby that comes with the OS or its better to remove it and just manage it by Port? Please answer like this one How to update to Ruby 1.8.7 don't helps me
Have you tried rvm gem? It manages Ruby versions installed, allow to compile most (if not all) actual (and archival) Ruby versions, sets proper environment variables pointing to actually used ruby version.
$ gem install rvm
$ rvm install 1.8.7
$ rvm use 1.8.7 --default
On my OS X machines I have several versions of Ruby installed.
I install then, from source, under /usr/local/ruby-1.X.X
Once you have multiple versions of Ruby installed you will need your environment to know which one to use.
I do this by setting the PATH, like so
export PATH="/usr/local/ruby-1.8.7/bin:$PATH";
See Hive Logic's article on installing Ruby