2016-05-16 26 views
2
LMagnotti$ rails c 

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. 
Ignoring bcrypt-3.1.11 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.11 
Ignoring binding_of_caller-0.7.3.pre1 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.3.pre1 
Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2 
Ignoring byebug-9.0.3 because its extensions are not built. Try: gem pristine byebug --version 9.0.3 
Ignoring byebug-9.0.0 because its extensions are not built. Try: gem pristine byebug --version 9.0.0 
Ignoring byebug-8.2.5 because its extensions are not built. Try: gem pristine byebug --version 8.2.5 
Ignoring byebug-3.4.0 because its extensions are not built. Try: gem pristine byebug --version 3.4.0 
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2 
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10 
Ignoring libxml-ruby-2.6.0 because its extensions are not built. Try: gem pristine libxml-ruby --version 2.6.0 
Ignoring nokogiri-1.6.7.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.2 
Ignoring pg-0.18.4 because its extensions are not built. Try: gem pristine pg --version 0.18.4 
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11 
Ignoring sqlite3-1.3.9 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.9 
Ignoring sqlite3-1.3.7 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.7 
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. 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find rake-11.1.2 in any of the sources (Bundler::GemNotFound) 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/spec_set.rb:88:in `map!' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/spec_set.rb:88:in `materialize' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/definition.rb:140:in `specs' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/definition.rb:185:in `specs_for' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/definition.rb:174:in `requested_specs' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/environment.rb:19:in `requested_specs' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/runtime.rb:14:in `setup' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler.rb:95:in `setup' 
    from /Library/Ruby/Gems/2.0.0/gems/bundler-1.12.0/lib/bundler/setup.rb:19:in `<top (required)>' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/commands.rb:33:in `<module:Spring>' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/commands.rb:4:in `<top (required)>' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/server.rb:9:in `<top (required)>' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/client/server.rb:9:in `call' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/client/command.rb:7:in `call' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/lib/spring/client.rb:30:in `run' 
    from /Users/LMagnotti/workspace/sample_app/vendor/cache/ruby/2.0.0/gems/spring-1.7.1/bin/spring:49:in `<main>' 

所以我嘗試捆綁立即安裝...由於未構建擴展,Rails控制檯將無法加載。有任何想法嗎?

LMagnotti$ bundle install 

Ignoring pg-0.18.4 because its extensions are not built. Try: gem pristine pg --version 0.18.4 
Using rake 11.1.2 
Using i18n 0.7.0 
Using json 1.8.3 
Using minitest 5.8.4 
Using thread_safe 0.3.5 
Using builder 3.2.2 
Using erubis 2.7.0 
Using mini_portile2 2.0.0 
Using rack 1.6.4 
Using mime-types-data 3.2016.0221 
Using arel 6.0.3 
Using debug_inspector 0.0.2 
Using sass 3.4.22 
Using byebug 9.0.3 
Using coffee-script-source 1.10.0 
Using execjs 2.6.0 
Using thor 0.19.1 
Using concurrent-ruby 1.0.2 
Using multi_json 1.12.0 
Using bundler 1.12.0 
Using tilt 2.0.4 
Using spring 1.7.1 
Using sqlite3 1.3.7 
Using rdoc 4.2.2 
Using tzinfo 1.2.2 
Using nokogiri 1.6.7.2 
Using rack-test 0.6.3 
Using mime-types 3.0 
Using binding_of_caller 0.7.2 
Using bootstrap-sass 3.2.0.2 
Using coffee-script 2.4.1 
Using uglifier 3.0.0 
Using sprockets 3.6.0 
Using sdoc 0.4.1 
Using activesupport 4.2.2 
Using loofah 2.0.3 
Using mail 2.6.4 
Using rails-deprecated_sanitizer 1.0.3 
Using globalid 0.3.6 
Using activemodel 4.2.2 
Using jbuilder 2.4.1 
Using rails-html-sanitizer 1.0.3 
Using rails-dom-testing 1.0.7 
Using activejob 4.2.2 
Using activerecord 4.2.2 
Using actionview 4.2.2 
Using actionpack 4.2.2 
Using actionmailer 4.2.2 
Using railties 4.2.2 
Using sprockets-rails 3.0.4 
Using coffee-rails 4.1.1 
Using jquery-rails 4.1.1 
Using rails 4.2.2 
Using sass-rails 5.0.4 
Using web-console 2.3.0 
Using turbolinks 2.5.3 
Updating files in vendor/cache 
Bundle complete! 14 Gemfile dependencies, 56 gems now installed. 
Bundled gems are installed into ./vendor/cache. 

都好!?不完全的。我現在再試試rails c來調出控制檯。我也試着做捆綁更新和其中的一切。

LMagnotti$ rails c 
Warning: Running `gem pristine --all` to regenerate your installed gemspecs(etc....) 

....現在我被困在一個永無止境的循環中。有任何想法嗎?

此外,在運行明顯的'gem pristine --all'命令之後:這裏是我得到的。

LMagnotti$ sudo gem pristine --all 
Restoring gems to pristine condition... 
Restored activesupport-4.2.2 
Skipped bigdecimal-1.2.8, it is a default gem 
Building native extensions. This could take a while... 
Restored binding_of_caller-0.7.2 
Restored builder-3.2.2 
Building native extensions. This could take a while... 
Restored byebug-9.0.3 
Building native extensions. This could take a while... 
Restored debug_inspector-0.0.2 
Restored erubis-2.7.0 
Building native extensions. This could take a while... 
Restored ffi-1.9.10 
Restored i18n-0.7.0 
Skipped io-console-0.4.5, it is a default gem 
Skipped json-1.8.3, it is a default gem 
Building native extensions. This could take a while... 
Restored libxml-ruby-2.8.0 
Restored loofah-2.0.3 
Restored mini_portile2-2.0.0 
Restored minitest-5.8.4 
Restored net-telnet-0.1.1 
Building native extensions. This could take a while... 
Restored nokogiri-1.6.7.2 
Restored power_assert-0.2.6 
Skipped psych-2.0.17, it is a default gem 
Restored rails-deprecated_sanitizer-1.0.3 
Restored rails-dom-testing-2.0.0 
Restored rails-dom-testing-1.0.7 
Restored rails-html-sanitizer-1.0.3 
Restored rake-11.1.2 
Restored rake-10.4.2 
Skipped rdoc-4.2.1, it is a default gem 
Restored rubygems-update-2.6.4 
Building native extensions. This could take a while... 
Restored sqlite3-1.3.11 
Restored test-unit-3.1.5 
Restored thread_safe-0.3.5 
Restored tzinfo-1.2.2 

然後再次運行rails c後,我們又回到了同樣的問題。

+4

run'bundle exec gem pristine --all' –

回答

1

一般來說,要運行:

bundle exec rails c 

這可以確保捆綁照顧你的所有寶石裝載的你,和你沒有得到任何驚喜。試一試。

3

你使用的是類似rvm的東西嗎?你有多個紅寶石安裝?

我發現在安裝了多個ruby版本之後,我必須爲我當前正在使用的ruby版本創建一個gemset,然後在成功啓動rails控制檯之前'使用'該gemset。