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>'
所以我现在尝试捆绑安装......
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....)
....现在我陷入了一个永无止境的循环。有什么想法吗?
此外,经过明显的宝石原始 - 所有&#39;命令:这是我得到的。
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后,我们又遇到了同样的问题。
答案 0 :(得分:3)
我发现在安装了多个版本的ruby之后,我不得不为我当前使用的ruby版本创建一个gemset,然后在我成功打开rails控制台之前“使用”那个gemset。
答案 1 :(得分:1)
一般来说,您想要运行:
bundle exec rails c
这可以确保捆绑商为您处理所有宝石装载,并且您不会有任何意外。试一试。
答案 2 :(得分:0)
这为我解决了这个问题:
bundle clean
我有一些旧的宝石,它们是用不同的红宝石制成的。显然,这些副本缺少本机扩展名,但仍显示在加载路径中,导致类似于“忽略nokogiri-1.7.1,因为其扩展名未构建”的消息。