So che ci sono un sacco di domande o simili sul web, ma non si adatta al mio caso. Sto installando Redmine, e quando chiamo bundle install
, ottengo questo errore:errore installazione bundle, imprevisto ':'
[!] There was an error parsing `Gemfile`: compile error - syntax error, unexpected ':', expecting $end
gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin, :jruby]
^. Bundler cannot continue.
L'errore è su questa linea (quella con prefisso ->
):
source 'https://rubygems.org'
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.5.0')
abort "Redmine requires Bundler 1.5.0 or higher (you're using #{Bundler::VERSION}).\nPlease update with 'gem update bundler'."
end
gem "rails", "4.2.3"
gem "jquery-rails", "~> 3.1.3"
gem "coderay", "~> 1.1.0"
gem "builder", ">= 3.0.4"
gem "request_store", "1.0.5"
gem "mime-types"
gem "protected_attributes"
gem "actionpack-action_caching"
gem "actionpack-xml_parser"
gem "loofah", "~> 2.0"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
-> gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin, :jruby]
gem "rbpdf", "~> 1.18.6"
# Optional gem for LDAP authentication
group :ldap do
gem "net-ldap", "~> 0.3.1"
end
come si dice in così tanti altri thread, una causa potrebbe essere che questo codice usa la "nuova" sintassi dell'hash rubino 1.9. Tuttavia, guardando le versioni:
$ ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
$ gem -v
2.2.2
$ bundle -v
Bundler version 1.10.6
$ bundle exec ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
$ which bundler
/usr/local/bin/bundler
EDIT: come suggerito da Arsen, questo comando mostra dove è il problema, lo leggerò alcune documentazioni su rubino e ambienti virtuali per farlo funzionare nel modo giusto:
$ bundle env
Environment
Bundler 1.10.6
Rubygems 1.8.24
Ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Git 2.5.1
Bundler settings
without
Set for your local app (/home/leo/http/redmine.leo-flaventin.com/redmine/.bundle/config): "development:test"
Gemfile
[...] #The redmine Gemfile
Poi, penso gemma sta usando ruby 2.2 (ma non ne sono sicuro) quindi penso che non ci dovrebbe essere alcun problema, ma dato che non so davvero l'universo rubino e v'è in realtà un errore, sono certamente sbagliato. Ecco perché chiedo l'aiuto della comunità ...
Quindi qualsiasi idea di cosa sta succedendo?
(ho potuto correggere il file utilizzando la vecchia sintassi hash, ma dal momento che vorrei utilizzare le versioni più recenti, penso che sarebbe solo spostare il problema)
Nota: l'ho postato qui poiché non penso che sia un problema relativo alla miniera, ma una versione rubino –
Utilizzi RVM? E cosa ti offre 'bundle exec ruby -v'? – wiesion
'$ bundle exec ruby -v' output:' ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] '(uguale a' ruby -v') L'ho aggiunto al post poiché potrebbe essere rilevante, ty :) –