【发布时间】:2021-09-20 22:18:01
【问题描述】:
我遇到了一个奇怪的错误,没有任何类型的 rails 命令正在执行。每当我输入 rails 命令时,我都会得到以下信息:
忽略 racc-1.5.2,因为它的扩展未构建。试试: gem pristine racc --version 1.5.2
(在下面重复大约 100 次):
bin/rails:2:in `load': /Users/robertmorris/Desktop/All Projects/Code School/my9s/bin/spring:11: syntax error, unexpected keyword_rescue, expecting keyword_end (SyntaxError) rescue Gem::LoadError ^ /Users/robertmorris/Desktop/All Projects/Code School/my9s/bin/spring:14: syntax error, unexpected keyword_end, expecting end-of-input from bin/rails:2:in `<main>'
我的 bin/spring 文件:
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
gem "bundler"
require "bundler"
# Load Spring without loading other gems in the Gemfile, for speed.
Bundler.locked_gems&.specs&.find { |spec| spec.name == "spring" }&.tap do |spring|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem "spring", spring.version
require "spring/binstub"
rescue Gem::LoadError
# Ignore when Spring is not installed.
end
end
谢谢!
【问题讨论】:
标签: ruby-on-rails ruby