简体   繁体   English

El Capitan更新rails

[英]El Capitan Update rails

Just updated my system to El Capitan and when launching the rails server (that worked perfectly on Yosemite) I get the following warning. 刚刚将我的系统更新为El Capitan,当启动rails服务器(在Yosemite上完美运行)时,我收到以下警告。

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 running the referenced 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 running: 还试过跑:

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, it can't even find the bundle install path. 所以现在,它甚至找不到捆绑安装路径。 Seems like the update has really messed it up. 好像更新真的搞砸了。


When I run gem pristine --all I get the following: 当我运行gem pristine --all我得到以下内容:

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

Solution is in the following link . 解决方案在以下链接中

Hardware 硬件

Upgrade to El Capitan, with Homebrew & Ruby 使用Homebrew和Ruby升级到El Capitan

... and Xcode and Java, etc. ......以及Xcode和Java等

If you don't already have homebrew installed, do that first, so you don't have to deal with SIP issues. 如果您还没有安装自制软件,请先执行此操作,这样您就不必处理SIP问题。 Install all Software Updates available in the Apple Menu, up to and including El Capitan. 安装Apple菜单中提供的所有软件更新,包括El Capitan。

After the installs and forced reboots my 27" Thunderbolt display wouldn't display anything. Unplug, replug didn't help. One more reboot fixed it. 在安装并强制重新启动后,我的27“Thunderbolt显示器不会显示任何内容。拔下插头,重新插入没有帮助。再一次重启就修复了它。

Software 软件

In order... 为了...

Xcode Xcode中

The El Capitan install wiped out my Xcode install, so I had to search for it in the App Store and reinstall. El Capitan安装消除了我的Xcode安装,所以我不得不在App Store中搜索它并重新安装。 I now believe that I deleted Xcode awhile ago and forgot, hence the reinstall. 我现在相信我之前删除了Xcode并忘了,因此重新安装。 I did this on a machine that I rarely use. 我是在一台我很少使用的机器上做到的。

After Xcode is finished installing, open iTerm, which I use as a Terminal.app replacement, or Terminal.app if you are so inclined. 在Xcode完成安装后,打开iTerm,我将其用作Terminal.app替代品,或者如果您愿意,可以打开Terminal.app。

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

A dialog opened, I chose "Install", which finished in about a minute. 打开一个对话框,我选择了“安装”,大约一分钟就完成了。

Java Java的

Next, run java, which prompts with a dialog that has a button "More Info" which takes you to a website where you can accept the license and download the Java .dmg file. 接下来,运行java,其中会出现一个对话框,其中包含一个“更多信息”按钮,该按钮会将您带到一个可以接受许可并下载Java .dmg文件的网站。 You need the JDK, not the JRE, if you intend to run java command-line based tools. 如果您打算运行基于Java命令行的工具,则需要JDK而不是JRE。

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

∴ java

No Java runtime present, requesting install.

Once downloaded, open the .dmg (for me it was jdk-8u60-macosx-x64.dmg ) and install, then restart iTerm. 下载后,打开.dmg(对我来说是jdk-8u60-macosx-x64.dmg )并安装,然后重启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)

Apps like RubyMine should work now, well, at least launch. 像RubyMine这样的应用程序现在可以正常工作,至少可以启动。

Homebrew 家酿

The doctor informed me of several warnings which I took care of as instructed. 医生告诉我几个警告,我按照指示照顾。

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

Then I was able to update Homebrew. 然后我就能更新Homebrew了。

∴ brew update

qt5 QT5

I know the capybara-webkit gem will require qt5, and I know qt is one of the primary remaining pain points in homebrew / El Capitan issues tracker, so I decided to get it out of the way first. 我知道capybara-webkit gem需要qt5,而且我知道qt是自制/ El Capitan问题跟踪器中主要的剩余痛点之一,所以我决定先把它弄出来。

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

That last line is required to make qmake available. 需要最后一行才能使qmake可用。 Check with which qmake. 检查qmake。 Otherwise you will end up with this on the Capybara install later on: 否则,您最终将在Capybara安装上结束此操作:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. Gem :: Ext :: BuildError:错误:无法构建gem原生扩展。

/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 GPG

Some software is now being signed with GPG, like RVM, for example, so install it. 有些软件现在正在使用GPG签名,例如RVM,所以请安装它。

∴ brew install gpg

RVM RVM

My Ruby was working, but I was having trouble with some native gem installations, so I decided to start fresh with a Ruby compiled against all the new homebrew and Xcode libraries. 我的Ruby正在工作,但是我遇到了一些本机gem安装的问题,所以我决定开始使用针对所有新的自制程序和Xcode库编译的Ruby。

∴ rvm implode

Implode actually failed to remove the main ~/.rvm directory due to permissions issues. 由于权限问题,Implode实际上无法删除主~/.rvm目录。 I had to sudo remove it. 我不得不把它删掉。

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

Follow the instructions here for installing RVM, I installed the development version, hoping it would have more El Capitan fixes in it: 按照此处的说明安装RVM,我安装了开发版本,希望它有更多的El Capitan修复程序:

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

The main app I currently work on is using Ruby 2.1.2, so I install that first, and then go to the project directory to have the gemset created and to bundle. 我目前使用的主要应用程序是使用Ruby 2.1.2,所以我先安装它,然后转到项目目录以创建gemset并捆绑。

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

Bundler version 1.9.7 because that's what Heroku is on, and I want to stay in sync, because 1.10* changed things that make the Gemfile.lock incompatible with 1.9.7 on the deployed server (for me, with multiple gem sources, private gem server, etc). Bundler版本1.9.7,因为这是Heroku所在的,我想保持同步,因为1.10 *改变了使Gemfile.lock与部署服务器上的1.9.7不兼容的东西(对我来说,有多个宝石源,私有)宝石服务器等)。

Postgres Postgres的

I also took the opportunity to upgrade to the latest Postgres.app. 我也借此机会升级到最新的Postgres.app。 Alternatively you can install postgres with brew install postgres. 或者,您可以使用brew install postgres安装postgres。 I choose Postgres.app begause it is supported directly by Heroku, and I like to think there is a parity win there somewhere. 我选择了Postgres.app,因为Heroku直接支持它,我喜欢认为那里有一个奇偶校验胜利。

You should try RVM or RBENV or whatever the flavor of the week is. 您应该尝试RVM或RBENV或本周的味道。 This will allow you to easily manage your Ruby Interpreters and Gemsets on a per project basis. 这将允许您基于每个项目轻松管理Ruby解释器和Gemsets。 I still use RVM and I'm quite happy with it. 我仍然使用RVM,我对它很满意。

https://rvm.io/rvm/install https://rvm.io/rvm/install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM