Gemspec no válido debido al formato de fecha en la especificación


Cuando incluyo una gema que hice, gracias a Bundler (versión 1.0.12), en un Gemfile y luego trato de agrupar o rastrillar así:

$ rake

Tengo este mensaje de error:

Invalid gemspec in [/Users/zagzag/.rvm/gems/ruby-1.9.2-p180@foobar/specifications/myplugin-1.0.0.gemspec]: invalid date format in specification: "2011-04-21 00:00:00.000000000Z"

Estoy en el último Mac OS X (10.6.4), con:

$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.4.0]

Y:

$ gem -v
Invalid gemspec in [/Users/zagzag/.rvm/gems/ruby-1.9.2-p180@foobar/specifications/myplugin-1.0.0.gemspec]: invalid date format in specification: "2011-04-21 00:00:00.000000000Z"
1.7.2

Realmente no veo cómo resolver este problema. Gracias por cualquier idea.

Author: Michiel de Mare, 2011-04-24

15 answers

Aquí está la forma en que soluciono el error "formato de fecha no válido en la especificación":

1.) Vaya a la carpeta de especificaciones ubicada en:

/usr/local/lib/ruby/gems/1.8/specifications/

2.) Encuentre la especificación que está causando el problema.

3.) Cambiar s.date = %q{2011-05-21 00:00:00.000000000Z} por s.date = %q{2011-05-21}

¡Eso es una VICTORIA para mí! Buena Suerte

 143
Author: ben hall,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-19 11:56:05

Aquí está el comando para arreglar esto para todas sus gemas:

perl -p -i -e 's/ 00:00:00.000000000Z//' ~/gems/specifications/*.gemspec

Convierte s.date = %q{2011-05-21 00:00:00.000000000Z} a s.date = %q{2011-05-21} y debería solucionar el problema.

 60
Author: Philippe Creux,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-03-19 11:57:37

Por favor note el comentario de Damian Nowak. Estos comandos posiblemente estropear sus rubygems!

En Ubuntu 11.10 lo siguiente solucionó este error:

sudo gem install rubygems-update
sudo update_rubygems     

Lo siguiente puede funcionar en algunos sistemas pero no en Debian:

sudo gem update --system
 21
Author: Mark,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-02-12 11:29:21

Puede actualizar su gem. Para arreglar esto, puede editar el archivo gemspecdirectamente - de

2011-04-21 00:00:00.000000000Z

A

YYYY-MM-DD

O actualiza tus rails también

sudo gem update rails

Solucionará el problema.

 14
Author: Sayuj,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-07-19 06:30:52

No especifique la hora... sólo la fecha. 2011-04-21 debería funcionar bien.

 6
Author: qrush,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-04-26 00:43:23

Tuvo el mismo problema. Parece un error en Rubygems. Aquí está el commit que lo arregló: https://github.com/rubygems/rubygems/commit/21cccd55b823848c5e941093a615b0fdd6cd8bc7

Es necesario actualizar rubygems y bundler a las últimas versiones. Si aún tiene problemas después de eso, es posible que deba eliminar y reinstalar las gemas que le están dando problemas.

 4
Author: spd,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-08-12 14:52:39

Esto es más un comentario a la respuesta de ben hall, pero no tengo ese privilegio todavía parece

Las actualizaciones de gema no parecían funcionar, creo que ni siquiera puede cargar la gema debido al mal formato de fecha. cambiar manualmente las fechas era demasiado frustrante para ir una por una, por lo que un grep:

grep -i *.gemspec -e '.*s\.date.*=.*%q{\(....-..-..\) \(.*Z\)}

Y para sed:

sed -i -e 's/\(.*\)s\.date.*=.*%q{\(....-..-..\) \(.*Z\)}/\1s.date = %q\{\2}/p' ./*.gemspec

Y bajo su propio riesgo!! Todavía soy un novato de sed, pero funcionó para mí;)

 3
Author: pdelanauze,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-22 19:32:19

En mi servidor slicehost, la carpeta de especificaciones se encontraba en un lugar diferente. Aquí está el camino:

/usr/lib/ruby/gems/1.8 / especificaciones

El error proporcionado debe dar la ruta a la carpeta de especificaciones.

 2
Author: ben hall,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-06 17:49:03

El enfoque de la escopeta: Desinstalar todas las gemas y volver a ejecutar bundler.

  1. gem list --no-version | xargs gem uninstall -aIx
  2. rm -i `rvm gemdir`/specifications/*.gemspec
  3. gem update --system
  4. gem install bundler
  5. bundle install
 2
Author: Jared Beck,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-29 23:06:42

(Hasta que el bug fix llegue a una versión estable de Rubygems) lo resolví reinstalando la misma versión de cualquier gema generadora de advertencias usando el interruptor version version del comando gem.

 1
Author: Pistos,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-29 19:04:28

Como dijo Ben Hall, debe corregir el archivo gemspec que puede cambiar de sistema a sistema. Para saber qué archivo es ver qué archivo es decir en el informe de error, por ejemplo:

Gemspec no válido en [/var/lib/gems/1.8/specifications / svn2git-2.1.2.gemspec]: fecha no válida formato en la especificación:"2011-12-28 00:00:00.000000000 Z"

En este ejemplo debe editar "/var/lib/gems/1.8/specifications/svn2git-2.1.2.gemspec "archivo y cambio" 2011-12-28 00:00:00.000000000 Z " para "2011-12-28" in s. date option.

 1
Author: PhoneixS,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-01-25 12:34:40

Tenía este problema todavía ahora. La actualización de Rubygems lo resolvió bien:

gem update --system
 1
Author: polarblau,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-01-24 08:46:45

Este es mi entorno:

RubyGems Environment:
- RUBYGEMS VERSION: 1.8.10
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.1.0]
- INSTALLATION DIRECTORY: /Users/user/.rvm/gems/ruby-1.9.2-p290@app
- RUBY EXECUTABLE: /Users/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/user/.rvm/gems/ruby-1.9.2-p290@app/bin
- RUBYGEMS PLATFORMS:
  - ruby
  - x86_64-darwin-11
- GEM PATHS:
   - /Users/user/.rvm/gems/ruby-1.9.2-p290@app
   - /Users/user/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
   - :update_sources => true
   - :verbose => true
   - :benchmark => false
   - :backtrace => false
   - :bulk_threshold => 1000
- REMOTE SOURCES:
   - http://rubygems.org/

Finalmente logré encontrar una causa / una manera de evitar estos errores en mi sistema. Acabo de volver a pepino y pepino-rails versión 1.0.2. Usando las últimas versiones estaba haciendo esto...

 0
Author: rchampourlier,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-13 12:36:56

Incluso si instala la última versión de una gema con un formato de fecha válido, asegúrese de gem cleanup GEMNAME después, ya que gem todavía se quejará de las especificaciones para las bibliotecas más antiguas.

 0
Author: Daniel Tsadok,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-11-28 22:13:57

Reinstalar sus gemas puede ser la solución en muchos de estos estados de máquina ligeramente diferentes.

En mi caso:

cd /Library/Ruby/Gems/1.8/specifications &&
sudo rm -rf *

En mi caso, las otras soluciones más creativas fallaron.

Mi problema era conseguir Invalid gemspec al intentar usar cocoapods. Corrí gem install cocoapods de nuevo y todo era de color de rosa.

 0
Author: james_womack,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-06-14 09:50:22