导轨-v
激活上面的命令将导致:
bin / rails:7:bin / rails:语法错误:“(”意外
我的引擎滑轨似乎无法正常运行,并且没有响应。
当我尝试调用rails -v或rails db:create之类的内容时,它会告诉您语法错误。
rails 返回相同的错误
这是我使用的.gemspec文件的其余部分:
# frozen_string_literal: true
$:.push File.expand_path('lib', __dir__)
# Maintain your gem's version:
require 'vulnerabilities/version'
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = 'vulnerabilities'
s.version = Vulnerabilities::VERSION
s.authors = ['Evgeny Karpenko']
s.email = ['e.karpenko@isoit.ru']
s.homepage = 'https://new.docshell.ru'
s.summary = 'Vulnerabilities Plugin for Docshell4'
s.description = 'VulnerabilitiesPlugin for Docshell4'
s.license = 'proprietary'
s.files = Dir['{app,config,db,lib}/**/*', 'MIT-LICENSE', 'Rakefile', 'README.md']
s.add_dependency 'rails', '~> 5.1.6', '>= 5.1.6.1'
s.add_dependency 'active_model_serializers', '~> 0.10.7'
s.add_dependency 'kaminari', '~> 1.1', '>= 1.1.1'
s.add_dependency 'pg', '~> 1.1', '>= 1.1.2'
s.add_dependency 'swagger-blocks', '~> 2.0.2'
s.add_dependency 'rest-client', '~> 2.0', '>= 2.0.2'
s.add_development_dependency 'annotate'
s.add_development_dependency 'database_cleaner'
s.add_development_dependency 'factory_bot_rails'
s.add_development_dependency 'faker'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rspec-instrumentation-matcher'
s.add_development_dependency 'rspec-rails'
s.add_development_dependency 'shoulda-matchers'
end
这是bin / rails文件,该文件无法运行File.expand_path
# frozen_string_literal: true
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.
ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/vulnerabilities/engine', __dir__)
APP_PATH = File.expand_path('../spec/dummy/config/application', __dir__)
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
require 'rails/all'
require 'rails/engine/commands'
答案 0 :(得分:2)
原因在这一行:
# frozen_string_literal: true
移除后-滑轨开始正常工作
此行是由于RuboCop干预而出现的