首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法为我的应用程序运行rails服务器

无法为我的应用程序运行rails服务器
EN

Stack Overflow用户
提问于 2020-11-16 17:10:45
回答 1查看 677关注 0票数 0

我正在尝试运行一个从互联网下载的项目,它是ruby on rails,我得到了以下错误

代码语言:javascript
复制
Traceback (most recent call last):
        4: from bin/rails:3:in `<main>'
        3: from bin/rails:3:in `load'
        2: from C:/Users/Amira/canvas/bin/spring:10:in `<top (required)>'
        1: from C:/Users/Amira/canvas/bin/spring:10:in `read'
C:/Users/Amira/canvas/bin/spring:10:in `read': No such file or directory @ rb_sysopen - C:/Users/Amira/canvas/Gemfile.lock (Errno::ENOENT)

在文件中编写的代码如下所示

代码语言:javascript
复制
#!/usr/bin/env ruby

# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.

unless defined?(Spring)
  require 'rubygems'
  require 'bundler'

  if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^    (?:  )*spring \((.*?)\)$.*?^$/m))
    Gem.paths = { 'GEM_PATH' => [Bundler.bundle_path.to_s, *Gem.path].uniq.join(Gem.path_separator) }
    gem 'spring', match[1]
    require 'spring/binstub'
  end
end

这是一个开源项目,我是新来的rails,有人能帮我吗?

编辑

Gemfile内容

代码语言:javascript
复制
# What have they done to the Gemfile???
#
# Relax. Breathe deep. All the gems are still there; they're just loaded in various files in Gemfile.d/
# This allows us to require gems locally that we might not want to commit to our public repo. We can maintain
# a customized list of gems for development and debuggery, without affecting our ability to merge with canvas-lms
#
# NOTE: this file has to use 1.8.7 hash syntax to not raise a parser exception on 1.8.7
#
# NOTE: some files in Gemfile.d/ will have certain required gems indented. While this may seem arbitrary,
# it actually has semantic significance. An indented gem required in Gemfile is a gem that is NOT
# directly used by Canvas, but required by a gem that is used by Canvas. We lock into specific versions of
# these gems to prevent regression, and the indentation serves to alert us to the relationship between the gem and canvas-lms
source 'https://rubygems.org/'


Dir[File.join(File.dirname(__FILE__), 'gems/plugins/*/Gemfile.d/_before.rb')].each do |file|
  eval(File.read(file), nil, file)
end

require File.expand_path("../config/canvas_rails_switcher", __FILE__)

Dir.glob(File.join(File.dirname(__FILE__), 'Gemfile.d', '*.rb')).sort.each do |file|
  eval(File.read(file), nil, file)
end
EN

回答 1

Stack Overflow用户

发布于 2020-11-17 08:49:45

Gemfile通常指定依赖项(应用程序需要的其他代码)。您所研究的项目似乎使用了稍微复杂一些的设置。

通常情况下,它的工作方式大致如下:一旦依赖项通过绑定程序(命令bundle或更显式的bundle install)安装,就会在其旁边放置一个Gemfile.lock,以列出实际使用的已安装依赖项的版本。

两个外卖:

dependencies.

  • read

  • 使用bundle ( gem称为bundler)来仔细安装项目的自述文件。如果它没有关于安装的说明,如果项目有这样做的方法,就创建一个问题。如果您是超级友好或正常的,并且项目是开放的和健康的,请为自述程序创建一个拉请求,其中描述如何安装该应用程序.

编辑这听起来可能有点傲慢,我没有偷看细节。我猜你跟踪了https://github.com/instructure/canvas-lms/wiki/Quick-Start。canvas项目使用的设置比典型的Rails应用程序稍微复杂一些。我相信你应该特别要求帆布安装的帮助(编辑你的问题)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64862501

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档