2016-03-03 2 views
0

Я использовал RVM, но теперь я пытаюсь использовать rbenv для тестирования, потому что он используется в учебнике, которое мне понравилось. Я установил rbenv с Homebrew. Тогда я закомментированная линию для загрузки RVM в моем ~/.bash_profile:Как использовать rbenv после использования RVM

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 

#[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 


eval "$(rbenv init -)" 
export PATH="$HOME/.rbenv/shims:$PATH" 

Я установил Ruby:

$ rbenv install 2.2.1 
$ rbenv global 2.2.1 

, но когда я пытаюсь установить Rails, я получаю эту ошибку:

$ gem install rails -v 4.2.0 --no-ri --no-rdoc 
Ignoring RedCloth-4.2.9 because its extensions are not built. Try: gem pristine RedCloth --version 4.2.9 
Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.10 
Ignoring bigdecimal-1.2.7 because its extensions are not built. Try: gem pristine bigdecimal --version 1.2.7 
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-8.2.2 because its extensions are not built. Try: gem pristine byebug --version 8.2.2 
Ignoring byebug-8.2.1 because its extensions are not built. Try: gem pristine byebug --version 8.2.1 
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2 
Ignoring eventmachine-1.0.9.1 because its extensions are not built. Try: gem pristine eventmachine --version 1.0.9.1 
Ignoring eventmachine-1.0.8 because its extensions are not built. Try: gem pristine eventmachine --version 1.0.8 
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2 
Ignoring fast-stemmer-1.0.2 because its extensions are not built. Try: gem pristine fast-stemmer --version 1.0.2 
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10 
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7 
Ignoring io-console-0.4.5 because its extensions are not built. Try: gem pristine io-console --version 0.4.5 
Ignoring nokogiri-1.6.7.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.2 
Ignoring nokogiri-1.6.7.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.1 
Ignoring nokogiri-1.6.7 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7 
Ignoring posix-spawn-0.3.11 because its extensions are not built. Try: gem pristine posix-spawn --version 0.3.11 
Ignoring psych-2.0.17 because its extensions are not built. Try: gem pristine psych --version 2.0.17 
Ignoring psych-2.0.16 because its extensions are not built. Try: gem pristine psych --version 2.0.16 
Ignoring rdiscount-2.1.8 because its extensions are not built. Try: gem pristine rdiscount --version 2.1.8 
Ignoring redcarpet-3.3.4 because its extensions are not built. Try: gem pristine redcarpet --version 3.3.4 
Ignoring redcarpet-3.3.3 because its extensions are not built. Try: gem pristine redcarpet --version 3.3.3 
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11 
Ignoring therubyracer-0.12.2 because its extensions are not built. Try: gem pristine therubyracer --version 0.12.2 
Ignoring thin-1.6.4 because its extensions are not built. Try: gem pristine thin --version 1.6.4 
Ignoring thin-1.5.1 because its extensions are not built. Try: gem pristine thin --version 1.5.1 
Ignoring yajl-ruby-1.2.1 because its extensions are not built. Try: gem pristine yajl-ruby --version 1.2.1 
Ignoring RedCloth-4.2.9 because its extensions are not built. Try: gem pristine RedCloth --version 4.2.9 
Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.10 
Ignoring bigdecimal-1.2.7 because its extensions are not built. Try: gem pristine bigdecimal --version 1.2.7 
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-8.2.2 because its extensions are not built. Try: gem pristine byebug --version 8.2.2 
Ignoring byebug-8.2.1 because its extensions are not built. Try: gem pristine byebug --version 8.2.1 
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2 
Ignoring eventmachine-1.0.9.1 because its extensions are not built. Try: gem pristine eventmachine --version 1.0.9.1 
Ignoring eventmachine-1.0.8 because its extensions are not built. Try: gem pristine eventmachine --version 1.0.8 
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2 
Ignoring fast-stemmer-1.0.2 because its extensions are not built. Try: gem pristine fast-stemmer --version 1.0.2 
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10 
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7 
Ignoring io-console-0.4.5 because its extensions are not built. Try: gem pristine io-console --version 0.4.5 
Ignoring nokogiri-1.6.7.2 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.2 
Ignoring nokogiri-1.6.7.1 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7.1 
Ignoring nokogiri-1.6.7 because its extensions are not built. Try: gem pristine nokogiri --version 1.6.7 
Ignoring posix-spawn-0.3.11 because its extensions are not built. Try: gem pristine posix-spawn --version 0.3.11 
Ignoring psych-2.0.17 because its extensions are not built. Try: gem pristine psych --version 2.0.17 
Ignoring psych-2.0.16 because its extensions are not built. Try: gem pristine psych --version 2.0.16 
Ignoring rdiscount-2.1.8 because its extensions are not built. Try: gem pristine rdiscount --version 2.1.8 
Ignoring redcarpet-3.3.4 because its extensions are not built. Try: gem pristine redcarpet --version 3.3.4 
Ignoring redcarpet-3.3.3 because its extensions are not built. Try: gem pristine redcarpet --version 3.3.3 
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11 
Ignoring therubyracer-0.12.2 because its extensions are not built. Try: gem pristine therubyracer --version 0.12.2 
Ignoring thin-1.6.4 because its extensions are not built. Try: gem pristine thin --version 1.6.4 
Ignoring thin-1.5.1 because its extensions are not built. Try: gem pristine thin --version 1.5.1 
Ignoring yajl-ruby-1.2.1 because its extensions are not built. Try: gem pristine yajl-ruby --version 1.2.1 
Error loading RubyGems plugin "/Users/romenigld/.rvm/gems/[email protected]/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError) 
Error loading RubyGems plugin "/Users/romenigld/.rvm/gems/[email protected]/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError) 
Ignoring psych-2.0.17 because its extensions are not built. Try: gem pristine psych --version 2.0.17 
ERROR: Error installing rails: 
    ERROR: Failed to build gem native extension. 

    /Users/romenigld/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20160303-58397-1nyc1kp.rb extconf.rb 
checking if the C compiler accepts ... yes 
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no 
Building nokogiri using packaged libraries. 
/Users/romenigld/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'mini_portile2' (~> 2.0.0.rc2) - did find: [mini_portile2-2.1.0] (Gem::LoadError) 
Checked in 'GEM_PATH=/Users/romenigld/.gem/ruby/2.2.0:/Users/romenigld/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0:/Users/romenigld/.rvm/gems/ruby-2.2.3', execute `gem env` for more information 
    from /Users/romenigld/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/dependency.rb:324:in `to_spec' 
    from /Users/romenigld/.rbenv/versions/2.2.1/lib/ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem' 
    from extconf.rb:396:in `<main>' 

extconf failed, exit code 1 

Gem files will remain installed in /Users/romenigld/.rvm/gems/ruby-2.2.3/gems/nokogiri-1.6.7.2 for inspection. 
Results logged to /Users/romenigld/.rvm/gems/ruby-2.2.3/extensions/x86_64-darwin-15/2.2.0-static/nokogiri-1.6.7.2/gem_make.out 

Возможно ли, что RVM и rbenv работают?

+0

Да, возможно, что RVM беспокоит. Вы должны использовать только один из них. – alebian

+0

Вы перезапустили оболочку после комментирования строки инициализации RVM? Запустите 'gem env' и скопируйте/вставьте вывод в свой вопрос, соответствующим образом форматируя его. RVM и rbenv могут * NOT * запускаться одновременно; В документах rbenv: «rbenv несовместим с RVM. Обязательно полностью удалите RVM и удалите любые ссылки на него из файлов инициализации оболочки перед установкой rbenv». –

ответ

2
"Gem files will remain installed in /Users/romenigld/.rvm" 

делает вид, что RVM все еще пытается контролировать вашу установку Ruby.

RVM не совместим с rbenv. Per the rbenv docs:

rbenv is incompatible with RVM. Please make sure to fully uninstall RVM and remove any references to it from your shell initialization files before installing rbenv.

Я настоятельно рекомендую прочитать документацию всей rbenv; Он охватывает это, наряду с использованием плагинов, которые улучшают использование rbenv.

 Смежные вопросы

  • Нет связанных вопросов^_^