2013-03-19 15 views
6

Mi sento un idiota compelte, ma ho continuato a scrivere tutto questo giorno e non ho trovato dove.Rubygems su OSX mancante

Ho riavviato più volte il tentativo di ottenere un'installazione completa di Ruby sul mio ambiente OSX, RVM, Brew, Ruby: e ogni volta che riesco a passare a Ruby, installarlo in fondo all'installazione di rubygems.

Il motivo per cui devo ricominciare è che l'RVM non si aggiornava in Jewelerybox dopo la mia prima installazione di successo (usato un pacchetto completo di RubyInstaller) quindi non potevo gestire le mie gemme - un problema causato dall'installazione iniziale di Ruby sul sistema che vive in/usr/local e non sotto la mia directory. Per risolvere questo problema ho disinstallato tutto il mio materiale Ruby e ricominciato.

Tutto ok finché il compilatore di ruby ​​ha iniziato a eseguire il gacking sulla sezione di installazione di rubygems durante l'installazione di Ruby 2.0.0. Controllando i file di sistema OSX sotto usr/bin vedo che i rubygems non ci sono (dovrebbe essere presente di default su OSX). Qualche idea? (Si noti che XCode è aggiornato e ha strumenti a linea di comando installato)

Ultimo tentativo è stato:

$ rvm get head --autolibs=3 # get the latest RVM and build required libs 
$ rvm requirements # just in case, install all other required stuff 
$ rvm remove 2.0.0 
$ rvm install ruby-2.0.0 

. . . che spara il seguente errore:

[2013-03-19 23:21:50] /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/bin/ruby 
Exception `LoadError' at /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1073 - cannot load such file -- rubygems/defaults/operating_system 
Exception `LoadError' at /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/rubygems.rb:1082 - cannot load such file -- rubygems/defaults/ruby 
mkdir -p /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0 

...

install -c -m 0755 /var/folders/nq/wkj89k854tl0w97n68qdn820pzk_51/T/gem.84634 /Users/matthew.evans/.rvm/rubies/ruby-2.0.0-p0/bin/gem 
rm /var/folders/nq/wkj89k854tl0w97n68qdn820pzk_51/T/gem.84634 
ERROR: While executing gem ... (NoMethodError) 
    undefined method `fu_stream_blksize' for #<Gem::Commands::SetupCommand:0x007ffd0e054818> 
Installing RubyGems 
Installing gem executable 
+0

provare quanto segue: 'echo $ {LANG: -empty}' 'poi export LANG = en_US.UTF-8'. Dopo di ciò, riprova. – fmendez

+0

@fmendez: Perché ?? – AGS

+0

@AGS A causa di un problema simile riportato qui: https://github.com/wayneeseguegu/rvm/issues/1689 e specchiato qui: https://github.com/rubygems/rubygems/issues/516 – fmendez

risposta

1

Credo che il problema è dove RVM mette le dipendenze - globali vs cartella utente. Da un libro intitolato "sviluppo agile con le rotaie":

First, you’ll need to make sure you have Xcode 3 or later installed...

$ xcodebuild -version 

If you have Xcode version 3 installed, you’ll need to install the Git version control system separately. Verify your installation by running the following command:

$ git --version 

Next, install RVM itself:

$ curl -L https://get.rvm.io | bash -s stable 

Exit your command window or Terminal application and open a new one. This causes your .bash_login to be reloaded. Execute the following command, which provides additional installation instructions tailored to your specific operating system:

$ rvm requirements 

Look for the line that tells you how to install the necessary OS dependencies for Ruby (MRI). Once you complete those instructions, you can proceed to install the Ruby interpreter itself:

$ rvm install 2.0.0 

The preceding step will take a while as it downloads, configures, and compiles the necessary executables. Once it completes, use that environment, and install rails:

$ rvm use 2.0.0 
$ gem install rails --version 4.0.0.beta1 --no-ri --no-rdoc 

With the exception of the rvm use statement, each of the above instructions need only be done once. The rvm use statement needs to be repeated each time you open a shell window. The use keyword is optional, so you can abbreviate this to rvm 2.0.0. You can also choose to make it the default Ruby interpreter for new terminal sessions with the following command:

$ rvm --default 2.0.0 

You can verify successful installation using the following command:

$ rails -v 

In caso di problemi, provare i suggerimenti elencati sotto la Risoluzione dei problemi del Installa voce sul sito rvm.

Spero che lo faccia per te!

+4

Ho trovato che mi mancavano alcuni requisiti di rvm. Una volta che è ordinato, 'rvm install 2.0.0' restituisce ancora un errore simile. ma eseguendo 'rvm rubygems latest' dopo aver installato correttamente i rubygems. – lulalala

3

Ho avuto esattamente lo stesso errore durante l'installazione di ruby ​​v2 in rvm oggi. Ero su un account utente su Ubuntu che aveva bisogno di usare 'sudo' - e inserire la password del mio account per sudo - per installare le dipendenze del SO.

La tua domanda menziona l'esecuzione di rvm requirements a installa le dipendenze. Questo sembra essere un nuovo comportamento in rvm, a partire dalla v1.19. Sembrava installare una serie di dipendenze bene.Ma poi l'installazione di ruby ​​bombardato.

Nelle versioni precedenti di RVM, digitando rvm requirements sarebbe solo lista le dipendenze per rvm e per Ruby, come in Archonic's risposta.

ho digitato rvm implode e poi ha iniziato finita:

\curl -L https://get.rvm.io | bash -s 1.18.21 
source /home/deploy/.rvm/scripts/rvm 
rvm requirements 

A quel punto ho potuto installare le librerie/strumenti che RVM detto che avevo bisogno di rvm e rubino, e quindi rvm install ruby-2.0.0-p0 riusciti.

+1

Per riferimento, le librerie "NEW" perse da 'requisiti rvm in rvm 1.19.0 erano: build-essential dpkg-dev g ++ g ++ - 4.6 libapr1 libaprutil1 libdb4.8 libdpkg-perl libneon27-gnutls libstdC++ 6- 4.6-dev sovversione di libsvn1 –

1

questo ha funzionato per me:

rvm get head 
rvm requirements 
rvm install ruby-2.0