2012-04-12 3 views
6

Sto usando le finestre e ho appena eseguito il comando:Ruby on Rails - che non può essere SystemTimer

C:\Sites\cmply>gem install SystemTimer -v '1.2.3' 

e ho ottenuto questo errore:

Temporarily enhancing PATH to include DevKit... 
Building native extensions. This could take a while... 
ERROR: Error installing SystemTimer: 
     ERROR: Failed to build gem native extension. 

     C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb 
creating Makefile 

make 
generating system_timer_native-i386-mingw32.def 
compiling system_timer_native.c 
In file included from system_timer_native.c:8:0: 
c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete 
system_timer_native.c: In function 'install_first_timer_and_save_original_configuration': 

qualche idea del perché? Prima di questo ho avuto un altro errore sospetto:

Gem files will remain installed in C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3 for inspection. 
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/SystemTimer-1.2.3/ext/system_timer/gem_make.out 
An error occured while installing SystemTimer (1.2.3), and Bundler cannot continue. 
Make sure that `gem install SystemTimer -v '1.2.3'` succeeds before bundling. 

e prima che ho avuto un altro errore che sembrava indicare che la mia versione di Ruby è in qualche modo fuori sincrono:

C:\Sites\cmply>bundle update rake 
Updating git://github.com/twitter/twitter-text-rb.git 
Fetching source index for http://rubygems.org/ 
Bundler could not find compatible versions for gem "activesupport": 
    In snapshot (Gemfile.lock): 
    activesupport (3.2.3) 

    In Gemfile: 
    rails (= 3.1.3) x86-mingw32 depends on 
     activesupport (= 3.1.3) x86-mingw32 

Running `bundle update` will rebuild your snapshot from scratch, using only 
the gems in your Gemfile, which may resolve the conflict. 

Quindi è tutto radicato in me con una versione rubino incompatibile? Come dovrebbe essere risolto?

Grazie!

+0

Ruby ha la sua classe 'Time' predefinita. perché hai bisogno di un altro gioiello per questo? – uday

+0

Puoi fornire la tua versione di Ruby? L'output del comando 'ruby -v'. –

+0

@uDaY 'SystemTimer' non è equivalente alla classe' Time', è un pezzo di torta completamente diverso. –

risposta

3

Ispezionando l'output si dice che si sta costruendo per Ruby 1.9.3 con i file include di 1.9.1.

Sembra che l'installazione di Ruby sia in qualche modo interrotta. Vorrei provare a reinstallare Ruby 1.9.3 e verificare che i file di inclusione esistano in c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.3/ e non in c:/RailsInstaller/Ruby1.9.3/include/ruby-1.9.1/.

19

Non è possibile installare gem di system_timer con Ruby 1.9, ma non è un bug, è una funzionalità. Ecco lo full explanation.

"system_timer is only relevant if you are running Ruby 1.8. You do not need it if you are running Ruby 1.9"

Se stai passando da Ruby 1,8-1,9, è sufficiente rimuovere la gemma system_time e aggiornare il codice trattare con timeout.