I'm running Mac OS 10.6.8 on older iMac that is Core Duo, so it's 32-bit only. When I went to the terminal, I saw that I have Ruby 1.8.7, RubyGems 1.3.5, and Rails 2.3.5. I want to upgrade my Rails to 3 - which IS supported with Ruby 1.8.7 - and tried to do with RVM and all, but could not do so. I now almost suspect if it's the compatibility issue between Rails and RubyGems, but I'm not sure. I also do not seem to be able to upgrade RubyGems either.
If anyone can help, that would be great...I am not even sure if it's possible in the system since two resources on this issue - one by Hive Logic and another from Rails Installer - both spoke only of 64-bit systems. Is Rails 3 not possible in 32-bit only systems? Or is there any other issue that I'm not aware of?
UPDATE: I'm putting updates from my terminal. Thanks to everyone taking a look!
gem install rails
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/labuser/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
ERROR: Error installing rails:
bundler requires RubyGems version >= 1.3.6
UPDATE 2: Okay, so I tried again after installing RVM. I did it yesterday but deleted RVM after it wasn't working...but maybe someone can see what this means!
rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.6/i386/ruby-1.9.3-p392.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Can not find compiler and 'make' tool - make sure Xcode and/or Command Line Tools are installed.
UPDATE 3 (Resolved): Figured I would update it in case anyone has a similar problem in the future. I had to use sudo command to get things going... I wasn't able to upgrade my Ruby version (stuck at 1.8.7) but RubyGems and Rails both got updated, so things were able to move...It's not really smooth though, and I'm encountering additional problems that I didn't see before (just FYI).
To install rails/ruby on mac, here is what is needed.
Get the development tools: Install compatible version of Xcode & the needed tools to compile ruby will get bundled. or get the CLI Tools download.
Use rvm to install latest ruby. Don't use ruby 1.8.7, always 1.9.3 or newer.
The CLI Tools download is not supported for Snow leopard, I think. so your only option now is to find a version of xcode that's compatible with Mac OS X SL & then use rvm.
Here is a direct link to XCode 3.2.6 for Snow Leopard directly from Apple which I found after running a google search.
Lastly, as you may have noticed being on SL puts you on disadvantage & makes development hard. so I would advice you to upgrade to latest supported release.
Related
I am trying to install the ruby 2.6.5 on mac having m1 pro chip but it's giving error of "__rvm_make -j10".
I tried to google but won't find error with "__rvm_make -j10". there is one question with the same error on stackoverflow and i tried the same method but it won't worked too.
i tried "rvm install 2.6.5 --with-out-ext=fiddle"
i tried with open ssl 1.0 too, but not any one worked.
sammalik#Sams-MacBook-Pro rubyporgram % rvm install 2.6.5
ruby-2.6.5 - #removing src/ruby-2.6.5 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/13.0/arm64/ruby-2.6.5.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Updating certificates bundle '/opt/homebrew/etc/openssl#1.1/cert.pem'
Requirements installation successful.
Installing Ruby from source to: /Users/sammalik/.rvm/rubies/ruby-2.6.5, this may take a while depending on your cpu(s)...
ruby-2.6.5 - #downloading ruby-2.6.5, this may take a while depending on your connection...
ruby-2.6.5 - #extracting ruby-2.6.5 to /Users/sammalik/.rvm/src/ruby-2.6.5 - please wait
ruby-2.6.5 - #configuring - please wait
ruby-2.6.5 - #post-configuration - please wait
ruby-2.6.5 - #compiling - please wait
Error running '__rvm_make -j10',
please read /Users/sammalik/.rvm/log/1668327329_ruby-2.6.5/make.log
There has been an error while running make. Halting the installation.
UPDATE: Here's an updated blog post I wrote with the possible options if you really must use Ruby 2.6.x: https://www.rubyonmac.dev/how-to-install-ruby-2-6-on-macos-13-ventura
Instead, I highly recommend updating your project to at least 2.7.7. Here's a detailed guide I wrote that shows How and Why to Upgrade the Ruby Version in Your Project
Ruby 2.6.x is no longer supported on any Mac that has version 14 or higher of Apple's command line tools, which would be the case on macOS Ventura (13.0). Assuming you have Homebrew installed, you can check which version you have by running brew config, and then look towards the bottom for the lines that starts with CLT: and Xcode:
Ruby 2.6 reached end of life in March 2022, so it should not be used in production for security reasons. A lot of people get stuck because they think they have to use the version of Ruby that's specified in the project's .ruby-version and/or Gemfile. Instead, it's recommended to update the project to a newer version.
In most cases, it would be as easy as following these steps:
Install Ruby 2.7.7
Replace "2.6.x" with "2.7.7" in .ruby-version and Gemfile, and any other file where the Ruby version is specified (except Gemfile.lock because it should never be edited manually)
Run bundle install
Update any gems if necessary
Run your tests and make sure your app still works
Now that you know the recommended approach, let's go over 2 solutions in case you have a special need to use Ruby 2.6 before you update to 2.7.7:
Install Ruby with Homebrew
Downgrade to version 13.4 of the command line tools
Install Ruby with Homebrew
Install Homebrew if you haven't already
Install Ruby 2.6.10: brew install ruby#2.6
Follow the instructions for setting your PATH. For example, Homebrew will say something like this:
By default, binaries installed by gem will be placed into:
/opt/homebrew/lib/ruby/gems/2.6.0/bin
You may want to add this to your PATH.
If you need to have ruby first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
The reason this works is because this is a pre-built version of Ruby that was compiled with version 13.3 of the command line tools. However, note that it's not officially supported.
Note that you'll need to disable RVM or any other version manager you might have used before. And you'll only be able to use 2.6.10 with this setup. You won't be able to switch to other versions that you might have installed with RVM or another version manager.
This is meant as a temporary solution so that you can run your project with 2.6.10 and then update it to 2.7.7. Also, note that either way, you will need to update your project to at least 2.6.10. There's absolutely no reason to use 2.6.5. You should always make sure your apps are running the latest version in a series. For 2.6, it's 2.6.10, for 2.7, it's 2.7.7, then 3.0.5, and 3.1.3.
Downgrade to version 13.4 of the command line tools
This is not possible on macOS Ventura (13.0), so don't waste your time trying. If you're on macOS Monterey, you can download version 13.4 of the command line tools from Apple's developer site, and then install them. I also wrote step-by-step instructions for installing version 13.4 of the command line tools if you need them.
The following works fine with macOS Ventura 13.1. You have to choose an older openssl version e.g. openssl#1.0.2t
Make sure you have home-brew installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(Optional) Check if you already have openssl versions installed via home-brew. Uninstall not ncessary versions brew uninstall openssl
Install openssl via home-brew: brew install openssl#1.0.2t
Check the path where your local home-brew packages go. In my case it is /usr/local/opt/openssl#1.0/.
Install ruby with rvm rvm install 3.1.3 --with-openssl-dir=/usr/local/opt/openssl#1.0/
I've been through a similar problem in Ubuntu 22.10. Here are some points that may help you:
Your OpenSSL may be too updated and probably has some breaking changes that don't allow some of your ruby C files to be compiled. Download a previous version at OpenSSL website, install it in a different location than your current version and use rvm install --with-openssl-dir=<old-openssl-dir> 2.6.5 as mentioned in Chris' answer.
Instead of using --with-openssl-dir option, you could add your old OpenSSL /bin and /include files directly in environment variables in your rvm command, like this: PATH=<old-openssl-bin-path>:$PATH C_INCLUDE_PATH=<old-openssl-include-path>:/usr/include rvm install 2.6.5. This could be useful in the case that --with-openssl-dir option isn't available for some reason. You also need to create links to the /lib files in your old OpenSSL folder. You'll probably find paired files like libssl.so and libssl.so.1.1. You can just move the version-named files into /usr/lib(or similar for macos), otherwise when you execute openssl command from your old OpenSSL folder, it will probably raise an error saying that openssl can't find libraries. If you choose to use this method, make sure that your rvm user bin files (at ~/.rvm/usr/bin) don't contain any files that may mess the ruby installing (like another openssl executable). You may get rid of this folder using rvm pkg remove.
Another possible solution is changing your gcc version. My OS came with gcc version 12.2.0, which comes with a change in computer gotos that failed my make step. To find errors in your ruby installation, check the make.log file specified at the rvm command error message and look for lines like this:
What should I do? Here is the error
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rails:18
You're running Mac OS. Apple ships Ruby with Mac OS, though it's there for Apple's own use. We can piggyback on it, but modifying it can cause problems, so we recommend using RVM or rbenv to install one or more Ruby versions in a sandbox, which allows us to update, add, delete gems at will without affecting Apple's Ruby.
RVM - very capable, also very confusing to people who don't take the time to read how it works and how to use it. We have more questions about problems with RVM on Stack Overflow for that reason. If you go this route READ THE ENTIRE INSTALLATION PAGE UNTIL YOU UNDERSTAND IT.
rbenv - a lighterweight tool similar to RVM, which offers the basics. It supports plugins which provide similar capabilities to what RVM offers.
I use them both, with rbenv being on my personal machine and work laptop.
You can also use Homebrew to install Ruby. It is nice when installing a single version but doesn't provide nearly the features/controls for managing multiple versions. I don't recommend or use it for installing or managing Ruby as a result.
You can also install from the source code. I don't recommend that unless you know what you're doing so that's all I'll say about it.
The OS version you're on is old, and no longer supported by Apple. You can upgrade to a newer Ruby but you'll also need to install your Xcode installation along with its related command-line tools. While RVM might find a prebuilt Ruby to install, any gems that have native extensions will need to be compiled, requiring Xcode, and finding Xcode that supports old OSes might be difficult.
You need an updated version of ruby to install rails:
Get Homebrew (a package manager)
Download the latest version of ruby (not the default mac one) brew install ruby
gem install rails
I just installed Rails on OSX. I used the stock version of Ruby and followed the following procedure:
Installed newest version of RubyGems
Ran sudo gem install rails --include-dependencies
Installed Mongrel using sudo gem install mongrel --include-dependencies
Rails is working just fine, but more reading led me to this setup guide:
http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx
This is essentially the exact same install I performed, except he compiles it from source code and installs to /usr/local -- I really like this idea, since it keeps the OSX install stock and confines all my dev stuff to one area.
So, assuming I want to follow these instructions, what do I need to do to revert my system back to "stock" ruby? Can I just uninstall the Rails and Mongrel gems? Will the upgraded RubyGems cause any issues?
Basically, my concern is that some other software unrelated to my development work will need to use OSX's stock Ruby, and I will have screwed it up somehow. Any advice to undo the 3 steps I listed above and get as close to stock as possible would be appreciated.
Thanks!
The article you are referring to is over three years old (which is outdated in the Rails community). My recommendation is:
Install XCode
Install Homebrew
Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.)
Install RVM
Install Ruby 1.9.2 (rvm install 1.9.2)
Switch to default (rvm 1.9.2 --default)
Install Rails (gem install rails)
Install Passenger (gem install passenger)
Each step will have a few more substeps but you should be able to look them up or be promted with them.
I can't remember why I did this but I do know that it worked and has caused no problems since. I moved /Library/Ruby to /Library/Ruby.broken and then installed Ruby from source into /usr/local.
There's something fundamentally missing with the stock Ruby in OSX. I wish I could remember what that was.
I've just gone to installed RoR on my snow leopard mac.. and found the rails gem was already installed..
is this normal? Does it need updating?
Does this get installed along with textmate?
It is installed with the Snow Leopard developer tools. Version 1.8.7 of Ruby is installed.
You should be fine for most your development needs. If you wish to upgrade just update the gems:
$ sudo gem install rubygems-update
$ sudo update_rubygems
$ sudo gem update
$ sudo gem update --system
$ sudo gem install rails
I found an incredibly well written install guide at The Pragmatic Studio called Installing Ruby 1.9 and Rails 3 on Mac OS X. It took about an hour to follow, including installing several prerequisites.
I'm hesitant to mess too much with OSX's native installation of ruby/rails, lest things get broken by an Apple system update, so I was very excited to learn about RVM (Ruby Version Manager) which is a cool tool for switching between different ruby/rails installations. The Pragmatic Studio tutorial walks you through installing rvm.
There are a few glitches with the guide, which I'll list here:
Git: I just installed git itself. You do not need to set up a github account.
Git: You may need to manually add /usr/local/git/bin to your PATH. (They don't explicitly tell you to)
RVM: The protocol for the rvm-install-head URL should be https, not http
RVM: The installer complained a lot, but it worked anyway.
RVM: The newly installed ruby 1.9.2 didn't activate until I ran 'rvm 1.9.2' in step 8
All told, this seems like a GREAT approach, and I'm really impressed with their install guide!
Yes, the rails gem is already installed along with Snow Leopard, because you installed developer tools, it's very normal.
But it's a little bit old, you need to update it.
TextMate did not bundle any RoR stuff with this. TextMate just included a lot of bundles which mainly consists of Python and Ruby scripts, if you do not have ruby, textmate will not work.
However, TextMate is originally made on Tiger 10.4, which bundled Ruby 1.8.2, and Snow Leopard bundled Ruby 1.8.7, so TextMate's bundles is not fully compatible with Snow Leopard
Refer to this and get some fix for these issues:
http://wiki.macromates.com/Troubleshooting/SnowLeopard
And also make sure you always keep your RoR bundle to the latest SVN is also a good habit
TextMate is just a text editor. It only understands Rails syntax and file structure making it easy to write Rails apps. That said, you still need to install Rails separately to create Rails apps.
well for me it worked this... I have mountain lion but it worked just fine...
I'm new to Ruby on Rails, and I'm in the process of setting it up on my OS X system. Most guides seem to recommend using MacPorts to install Ruby and RubyGems, then using RubyGems from there on to install gems. I've noticed that MacPorts also offers many gems (though they're missing some and others seem a few releases behind), and I'm worried that it will somehow conflict with the stuff I'm installing using RubyGems.
Does anyone have any experience working with this kind of setup? Any advice? I want to get this right the first time so I don't end up having things break later on.
Thanks,
Grant
I recommend using Macports to install Ruby, and then download and installing the latest version of Rubygems by following the instructions on http://rubyonrails.org/down. When you want to install a new gem, use Rubygems, not MacPorts.
I use MacPorts to install Ruby and RubyGems, but then I install gems using the gem command (not port). I've found that Ruby gems in MacPorts aren't well-maintained, and the latest MacPorts version is often significantly behind the "real" version (for lack of a better term).
MacPorts is great for lots of things. However, RVM is generally a more flexible way to install Ruby, because it makes it easy to install an appropriate Ruby interpreter per project.