Gitlab PUSH语法错误,意外的':',期待$结束 [英] Gitlab PUSH syntax error, unexpected ':', expecting $end
问题描述
我安装了Gitlab 5,它们都运行得很顺利,直到我试图进行测试PUSH。错误是:
remote:/usr/local/rvm/gems/ruby-2.0.0-p0/gems/bundler -1.3.5 / lib / bundler / dsl.rb:33:在`eval_gemfile'中:Gemfile语法错误:( Bundler :: GemfileError)
remote:/ home / git / gitlab / Gemfile:14:语法错误,意想不到的':',期待$ end
remote:gemmysql2,group::mysql
remote:^
我在互联网上进行了搜索(很好,有点),但大多数答案是关于使用较低版本的红宝石(1.8.7)。这里不是这种情况,正如你所看到的,我正在使用2.0.0-p0。
我附加了Gemfile,它来自Gitlab源代码,所以我认为它没有任何问题。以防万一:
源码https://rubygems.org
def darwin_only(require_as )
RUBY_PLATFORM.include?('darwin')&& require_as
end
def linux_only(require_as)
RUBY_PLATFORM.include?('linux')&& require_as
end
gemrails,3.2.13
#支持的数据库
gemmysql2,group :: mysql
gempg,group::postgres
#Auth
gemdevise
gem'omniauth',〜> 1.1.3
gem'omniauth-google-oauth2'
gem'omniauth-twitter'
gem'omniauth-github'
从git仓库中提取信息
#由于gollum需要勇气,我们不能再使用gitlab-grit gem name。使用砂砾代替
gemgrit,'〜> 2.5.0',git:'https://github.com/gitlabhq/grit.git',ref:'42297cdcee16284d2e4eff23d41377f52fc28b9d'
gem'grit_ext','〜> 0.8.1'
#Ruby / Rack Git Smart-HTTP Server Handler
gem'gitlab-grack','〜> 1.0.0',要求:'grack'
#LDAP认证
gem'gitlab_omniauth-ldap','1.0.2',要求:omniauth-ldap
#语法highlighter
gemgitlab-pygments.rb,'〜> 0.3.2',要求:'pygments.rb'
#语言检测
gemgithub-linguist,〜> 2.3.4,要求:语言学家
#API
gemgrape,〜> 0.3.1
gemgrape-entity,〜> 0.2.0
#格式化日期和时间
#基于人性化的示例
gemstamp
#枚举字段
gem'enumerize'
#分页
gemkaminari,〜> 0.14.1
#HAML
gemhaml-rails
#文件附件
gemcarrierwave
#授权
gemsix
#种子数据
gemseed-fu
#标记为HTML
gemredcarpet,〜> 2.2.2
gemgithub-markup,〜> 0.7.4,要求:'github / markup'
#服务器
gempuma,'〜> 2.0.0.b7'
#状态机
gemstate_machine
#问题标签
gemacts-as-taggable-on ,2.3.3
#后台工作
gem'slim'
gem'sinatra',要求:无
gem'sidekiq'
#HTTP请求
gemhttparty
#彩色输出到控制台
gem彩色
#GitLab设置
gem'settingslogic'
#Git Wiki
gemgollum-lib,〜> 1.0.0
#Misc
gem工头
#Cache
gemredis-rails
组:资产do
gemsass-rails,〜> 3.2 .5
gemcoffee-rails,〜> 3.2.2
gemuglifier,〜> 1.3.0
gemtherubyracer
gem'selected-rails','0.9.8'
gem'select2-rails'
gem'jquery-atwho-rails',0.1.7
gem jquery-rails,2.1.3
gemjquery-ui-rails,2.0.2
gemmodernizr,2.6.2
gemraphael -rails,git:https: $ g
gemfont-awesome-sass-rails,〜& 3.0.0
gemgemoji,〜> 1.2.1,要求:'emoji / railtie'
gemgon
end
group:开发do
gemannotate,git:https ://github.com/ctran/annotate_models.git
gemletter_opener
gem'quiet_assets','〜> 1.0.1'
gem'rack-mini-profiler'
#更好的错误处理程序
gem'better_errors'
gem'binding_of_caller'
gem'rails_best_practices'
#文档生成器
gemsdoc
#thin而不是webrick
gem'thin'
end
group:development,:test do
gem '工作服',要求:false
gem'rails-dev-tweaks'
gem'spinach-rails'
gemrspec-rails
gem水豚
gempry
gemawesome_print
gemdatabase_cleaner
gemlaunchy
gem'factory_girl_rails'
#生成假数据
gemffaker
#Guard
gem'guard-rspec'
gem'guard-spinach'
#通知
gem'rb-fsevent',要求:darwin_only('rb-fsevent')
gem'growl',要求:darwin_only('growl')
gem'rb-inotify',需要:linux_only('rb-inotify')
#为Phaybom的驱动程序Capybara
gem'poltergeist',git:'https:// github。 com / jonleighton / poltergeist.git',ref:'9645b52009e258921b860d3b7601d00008b22c45'
gem'spork','〜> 1.0rc'
end
group:test do
gemsimplecov,要求:false
gemshoulda-matchers,1.3.0
gem'email_spec'
gemwebmock
gem'test_after_commit'
end
group:production do
gemgitlab_meta,'5.0 '
end
任何人都可以帮忙吗?提前致谢。
解决了这个问题。不知何故,Gitlab的宝石(捆绑?)仍然使用系统红宝石(1.8.7)。我不得不 yum remove
它,而且现在工作。
I've installed Gitlab 5, all ran smoothly until I attempted to make a test PUSH. The error is:
remote: /usr/local/rvm/gems/ruby-2.0.0-p0/gems/bundler-1.3.5/lib/bundler/dsl.rb:33:in `eval_gemfile': Gemfile syntax error: (Bundler::GemfileError)
remote: /home/git/gitlab/Gemfile:14: syntax error, unexpected ':', expecting $end
remote: gem "mysql2", group: :mysql
remote: ^
I searched all over the internet (well, kind of), but mostly the answer is about using a lower version of ruby (1.8.7). Which is not the case here, as you can see, I'm using 2.0.0-p0.
I'm attaching the Gemfile as well, which is from Gitlab source code, so I reckon there's nothing wrong with it. Just in case:
source "https://rubygems.org"
def darwin_only(require_as)
RUBY_PLATFORM.include?('darwin') && require_as
end
def linux_only(require_as)
RUBY_PLATFORM.include?('linux') && require_as
end
gem "rails", "3.2.13"
# Supported DBs
gem "mysql2", group: :mysql
gem "pg", group: :postgres
# Auth
gem "devise"
gem 'omniauth', "~> 1.1.3"
gem 'omniauth-google-oauth2'
gem 'omniauth-twitter'
gem 'omniauth-github'
# Extracting information from a git repository
# Since gollum requires grit we cannot use gitlab-grit gem name any more. Use grit instead
gem "grit", '~> 2.5.0', git: 'https://github.com/gitlabhq/grit.git', ref: '42297cdcee16284d2e4eff23d41377f52fc28b9d'
gem 'grit_ext', '~> 0.8.1'
# Ruby/Rack Git Smart-HTTP Server Handler
gem 'gitlab-grack', '~> 1.0.0', require: 'grack'
# LDAP Auth
gem 'gitlab_omniauth-ldap', '1.0.2', require: "omniauth-ldap"
# Syntax highlighter
gem "gitlab-pygments.rb", '~> 0.3.2', require: 'pygments.rb'
# Language detection
gem "github-linguist", "~> 2.3.4" , require: "linguist"
# API
gem "grape", "~> 0.3.1"
gem "grape-entity", "~> 0.2.0"
# Format dates and times
# based on human-friendly examples
gem "stamp"
# Enumeration fields
gem 'enumerize'
# Pagination
gem "kaminari", "~> 0.14.1"
# HAML
gem "haml-rails"
# Files attachments
gem "carrierwave"
# Authorization
gem "six"
# Seed data
gem "seed-fu"
# Markdown to HTML
gem "redcarpet", "~> 2.2.2"
gem "github-markup", "~> 0.7.4", require: 'github/markup'
# Servers
gem "puma", '~> 2.0.0.b7'
# State machine
gem "state_machine"
# Issue tags
gem "acts-as-taggable-on", "2.3.3"
# Background jobs
gem 'slim'
gem 'sinatra', require: nil
gem 'sidekiq'
# HTTP requests
gem "httparty"
# Colored output to console
gem "colored"
# GitLab settings
gem 'settingslogic'
# Git Wiki
gem "gollum-lib", "~> 1.0.0"
# Misc
gem "foreman"
# Cache
gem "redis-rails"
group :assets do
gem "sass-rails", "~> 3.2.5"
gem "coffee-rails", "~> 3.2.2"
gem "uglifier", "~> 1.3.0"
gem "therubyracer"
gem 'chosen-rails', "0.9.8"
gem 'select2-rails'
gem 'jquery-atwho-rails', "0.1.7"
gem "jquery-rails", "2.1.3"
gem "jquery-ui-rails", "2.0.2"
gem "modernizr", "2.6.2"
gem "raphael-rails", git: "https://github.com/gitlabhq/raphael-rails.git"
gem 'bootstrap-sass', "2.2.1.1"
gem "font-awesome-sass-rails", "~> 3.0.0"
gem "gemoji", "~> 1.2.1", require: 'emoji/railtie'
gem "gon"
end
group :development do
gem "annotate", git: "https://github.com/ctran/annotate_models.git"
gem "letter_opener"
gem 'quiet_assets', '~> 1.0.1'
gem 'rack-mini-profiler'
# Better errors handler
gem 'better_errors'
gem 'binding_of_caller'
gem 'rails_best_practices'
# Docs generator
gem "sdoc"
# thin instead webrick
gem 'thin'
end
group :development, :test do
gem 'coveralls', require: false
gem 'rails-dev-tweaks'
gem 'spinach-rails'
gem "rspec-rails"
gem "capybara"
gem "pry"
gem "awesome_print"
gem "database_cleaner"
gem "launchy"
gem 'factory_girl_rails'
# Generate Fake data
gem "ffaker"
# Guard
gem 'guard-rspec'
gem 'guard-spinach'
# Notification
gem 'rb-fsevent', require: darwin_only('rb-fsevent')
gem 'growl', require: darwin_only('growl')
gem 'rb-inotify', require: linux_only('rb-inotify')
# PhantomJS driver for Capybara
gem 'poltergeist', git: 'https://github.com/jonleighton/poltergeist.git', ref: '9645b52009e258921b860d3b7601d00008b22c45'
gem 'spork', '~> 1.0rc'
end
group :test do
gem "simplecov", require: false
gem "shoulda-matchers", "1.3.0"
gem 'email_spec'
gem "webmock"
gem 'test_after_commit'
end
group :production do
gem "gitlab_meta", '5.0'
end
Could anyone help? Thanks in advance.
Solved this. Somehow Gitlab gems (bundles?) still used the system ruby (1.8.7). I had to yum remove
it, and things work now.
这篇关于Gitlab PUSH语法错误,意外的':',期待$结束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!