Lir*_*roy 6 ruby-on-rails osx-elcapitan
刚刚将我的系统更新为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.
Run Code Online (Sandbox Code Playgroud)
当我运行引用的命令时,我得到:
-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.
Run Code Online (Sandbox Code Playgroud)
还试过跑:
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
Run Code Online (Sandbox Code Playgroud)
所以现在,它甚至找不到捆绑安装路径.好像更新真的搞砸了.
当我跑步时,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
Run Code Online (Sandbox Code Playgroud)
解决方案在以下链接中.
使用Homebrew和Ruby升级到El Capitan
......以及Xcode和Java等
如果您还没有安装自制软件,请先执行此操作,这样您就不必处理SIP问题.安装Apple菜单中提供的所有软件更新,包括El Capitan.
在安装并强制重新启动后,我的27"Thunderbolt显示器不会显示任何内容.拔下插头,重新插入没有帮助.再一次重启就修复了它.
为了...
El Capitan安装消除了我的Xcode安装,所以我不得不在App Store中搜索它并重新安装.我现在相信我之前删除了Xcode并忘了,因此重新安装.我是在一台我很少使用的机器上做到的.
在Xcode完成安装后,打开iTerm,我将其用作Terminal.app替代品,或者如果您愿意,可以打开Terminal.app.
? xcode-select --install
xcode-select: note: install requested for command line developer tools
Run Code Online (Sandbox Code Playgroud)
打开一个对话框,我选择了"安装",大约一分钟就完成了.
接下来,运行java,其中会出现一个对话框,其中包含一个"更多信息"按钮,该按钮会将您带到一个可以接受许可并下载Java .dmg文件的网站.如果您打算运行基于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.
Run Code Online (Sandbox Code Playgroud)
下载后,打开.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)
Run Code Online (Sandbox Code Playgroud)
像RubyMine这样的应用程序现在可以正常工作,至少可以启动.
医生告诉我几个警告,我按照指示照顾.
? 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
Run Code Online (Sandbox Code Playgroud)
然后我就能更新Homebrew了.
? brew update
Run Code Online (Sandbox Code Playgroud)
我知道capybara-webkit gem需要qt5,而且我知道qt是homebrew/El Capitan问题跟踪器中的主要剩余痛点之一,所以我决定先把它弄出来.
? brew uninstall qt5
? brew install qt5
? brew linkapps qt5
? brew link --force qt5
Run Code Online (Sandbox Code Playgroud)
需要最后一行才能使qmake可用.检查qmake.否则,您最终将在Capybara安装上结束此操作:
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 ***
Run Code Online (Sandbox Code Playgroud)
有些软件现在正在使用GPG签名,例如RVM,所以请安装它.
? brew install gpg
Run Code Online (Sandbox Code Playgroud)
我的Ruby正在工作,但是我遇到了一些本机gem安装的问题,所以我决定开始使用针对所有新的自制程序和Xcode库编译的Ruby.
? rvm implode
Run Code Online (Sandbox Code Playgroud)
~/.rvm由于权限问题,Implode实际上无法删除主目录.我不得不把它删掉.
? sudo rm -rf /Users/pboling/.rvm
Run Code Online (Sandbox Code Playgroud)
按照此处的说明安装RVM,我安装了开发版本,希望它有更多的El Capitan修复程序:
? gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
? \curl -sSL https://get.rvm.io | bash
Run Code Online (Sandbox Code Playgroud)
我目前使用的主要应用程序是使用Ruby 2.1.2,所以我先安装它,然后转到项目目录以创建gemset并捆绑.
? rvm install 2.1.2
? cd ~/project
? gem install bundler -v 1.9.7
? bundle install
Run Code Online (Sandbox Code Playgroud)
Bundler版本1.9.7,因为这就是Heroku的用途,我希望保持同步,因为1.10*更改Gemfile.lock了部署服务器上与1.9.7不兼容的东西(对我来说,有多个gem源,私有gem服务器,等等).
我也借此机会升级到最新的Postgres.app.或者,您可以使用brew install postgres安装postgres.我选择了Postgres.app,因为Heroku直接支持它,我喜欢认为那里有一个奇偶校验胜利.
| 归档时间: |
|
| 查看次数: |
7600 次 |
| 最近记录: |