El Capitan upgrade rails

I just upgraded my system to El Capitan and when I started the rails server (which worked fine on Yosemite) I received the following warning.

Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.10 Ignoring bcrypt-ruby-3.1.2 because its extensions are not built. Try: gem pristine bcrypt-ruby --version 3.1.2 Ignoring bcrypt-ruby-3.0.1 because its extensions are not built. Try: gem pristine bcrypt-ruby --version 3.0.1 Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2 Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring. 

when starting the reference commands, I get:

 -bash: bundle: command not found rails update Ignoring json-1.8.1 because its extensions are not built. Try: gem pristine json --version 1.8.1 Ignoring json-1.8.2 because its extensions are not built. Try: gem pristine json --version 1.8.2 Ignoring json-1.8.3 because its extensions are not built. Try: gem pristine json --version 1.8.3 Ignoring nokogiri-1.6.6.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.6.2 Ignoring atomic-1.1.14 because its extensions are not built. Try: gem pristine atomic --version 1.1.14 Ignoring atomic-1.1.14 because its extensions are not built. Try: gem pristine atomic --version 1.1.14 Ignoring bcrypt-ruby-3.0.1 because its extensions are not built. Try: gem pristine bcrypt-ruby --version 3.0.1 Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2 Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring. Could not find bcrypt-3.1.10 in any of the sources Run `bundle install` to install missing gems. 

also tried to run:

 sudo gem pristine --all Restoring gems to pristine condition... ERROR: While executing gem ... (Errno::EPERM) Operation not permitted - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0/gems/CFPropertyList-2.2.8/README 

So, now he can’t even find the package installation path. It seems like the update really messed it up.


When I run gem pristine --all , I get the following:

 Restored bcrypt-ruby-3.1.5 Skipped bigdecimal-1.2.0, it is a default gem Building native extensions. This could take a while... Restored binding_of_caller-0.7.2 Restored bootstrap-sass-3.3.5.1 Restored builder-3.2.2 Restored builder-3.1.4 Restored bundler-1.10.6 Restored bundler-1.9.6 Building native extensions. This could take a while... ERROR: While executing gem ... (Gem::Ext::BuildError) ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151001-3494-1jca623.rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15/ruby/config.h', needed by `breakpoint.o'. Stop. make failed, exit code 2 Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/byebug-6.0.2 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/byebug-6.0.2/gem_make.out 
+6
source share
2 answers

The solution is as follows.

Equipment

Upgrade to El Capitan, with Homebrew and Ruby

... and Xcode and Java, etc.

If you don’t have homegrown yet, do it first, so you don’t have to deal with SIP problems. Install all software updates available on the Apple menu, up to El Capitan.

After installation and a forced reboot, my 27-inch Thunderbolt display will not display anything. Disconnect, replug did not help. Another reboot fixed it.

Software

OK...

Xcode

Installing El Capitan destroyed my Xcode installation, so I had to search for it in the App Store and reinstall it. I now believe that I uninstalled Xcode some time ago and forgot, therefore, to reinstall. I did this on a machine that I rarely use.

After completing the installation of Xcode, open iTerm, which I use as a replacement for Terminal.app, or Terminal.app, if you are so inclined.

 ∴ xcode-select --install xcode-select: note: install requested for command line developer tools 

The dialog box is open, I chose Install, which ended in about a minute.

Java

Then run java, which will bring up a dialog box that says “More info” that will take you to a website where you can accept the license and download the Java.dmg file. You need a JDK, not a JRE, if you intend to run command line java tools.

 Unable to find any JVMs matching version "1.7". No Java runtime present, try --request to install. ∴ java No Java runtime present, requesting install. 

After downloading, open .dmg (for me it was jdk-8u60-macosx-x64.dmg ) and install, then restart iTerm.

 java -version java version "1.8.0_60" Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) 

Applications like RubyMine should work now, well, at least run.

Homebrew

The doctor informed me of several warnings that I took care of as indicated.

 ∴ brew doctor ∴ sudo chown -R $(whoami):admin /usr/localcd /usr/local/Library && git stash && git clean -d -f ∴ cd ~ ∴ brew prune ∴ brew unlink qt5 

Then I was able to update Homebrew.

 ∴ brew update 

qt5

I know that the capybara-webkit stone will require qt5, and I know that qt is one of the main remaining pain points in the homebrew / El Capitan trackers, so I decided to get rid of it first.

 ∴ brew uninstall qt5 ∴ brew install qt5 ∴ brew linkapps qt5 ∴ brew link --force qt5 

To make qmake available, the last line is required. Check with which qmake. Otherwise, you will end up with this on the Capybara installation later:

Gem :: Ext :: BuildError: ERROR: Failed to create custom gem extension.

 /Users/pboling/.rvm/rubies/ruby-2.1.2/bin/ruby -r ./siteconf20150930-48087-1vw6bye.rb extconf.rb sh: qmake: command not found *** extconf.rb failed *** 

GPG

Some software now subscribes with GPG, such as RVM, so install it.

 ∴ brew install gpg 

RVM

My Ruby worked, but I had problems with some built-in settings for creating gems, so I decided to start a new one with Ruby compiled against all the new homebrew and Xcode libraries.

 ∴ rvm implode 

Implode was actually unable to delete the main ~/.rvm due to permission problems. I had to remove it.

 ∴ sudo rm -rf /Users/pboling/.rvm 

Follow the RVM installation instructions, I installed the development version, hoping that it will have more El Capitan fixes:

 ∴ gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 ∴ \curl -sSL https://get.rvm.io | bash 

The main application I'm working on now uses Ruby 2.1.2, so I install it first and then go to the project directory to create and build the gemset.

 ∴ rvm install 2.1.2 ∴ cd ~/project ∴ gem install bundler -v 1.9.7 ∴ bundle install 

Bundler version 1.9.7 because this is what Heroku is on and I want to stay in sync because 1.10 * changed what makes Gemfile.lock incompatible with 1.9.7 on a deployed server (for me, with several gems sources, private gem server, etc.).

Postgres

I also took the opportunity to upgrade to the latest version of Postgres.app. Alternatively, you can install postgres with brew installing postgres. I choose Postgres.app because it is directly supported by Heroku, and I like to think that there is a victory in parity somewhere.

+5
source

You should try RVM or RBENV or something like this week. This allows you to easily manage your Ruby Interpreters and Gemsets based on each project. I am still using RVM and I am very pleased with that.

https://rvm.io/rvm/install

+2
source

All Articles