我知道網上有很多問題或類似問題,但它不適合我的情況。 我安裝redmine的,當我打電話bundle install
,我得到這個錯誤:捆綁安裝錯誤,意外':'
[!] 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.
的錯誤是在這條線(一個由->
前綴):像它在據說
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
很多其他線程,原因可能是該代碼使用「新」ruby 1.9哈希語法。然而,看着版本:
$ 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
編輯:由阿爾森的建議,這個命令顯示問題出在哪裏,我會讀到紅寶石和虛擬環境中的一些單證得到它的工作的正確方法:
$ 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
然後,我認爲創業板是用Ruby 2.2(但我不知道),所以我覺得不應該有任何問題,但因爲我真的不知道紅寶石宇宙,實際上有一個錯誤,我當然是錯的。這就是爲什麼我要求社區的幫助...
因此,有什麼想法呢?
(我可以糾正使用舊的哈希語法的文件,但因爲我想用最新的版本,我認爲這將只是移動的問題)
注意:由於我不認爲這是與redmine相關的問題,而是紅寶石版本 –
您是否使用RVM? 'bundle exec ruby -v'會給你帶來什麼? – wiesion
'$ bundle exec ruby -v'輸出:'ruby 2.1.5p273(2014-11-13)[x86_64-linux-gnu]'(與'ruby -v'相同)我將它添加到帖子中,因爲它可能是相關的,ty :) –