我找不到 Ruby 网络应用程序的代码

如何解决我找不到 Ruby 网络应用程序的代码

我对 Web 开发非常陌生,但对整个编程并不陌生。我对这个应用程序感到非常困惑,因为通常会修复它的人不能再修复它。

这可能是一个愚蠢的问题,但我找不到包含实际网页的代码或任何 HTML。在主文件夹 ~/myapp 中,包含:

- README.txt
- build
- env
    - bin
    - include
    - lib
    - local
    - man
    - passenger_wsgi.py
    - passenger_wsgi.pyc
    - pip-selfcheck.json
    - public
        - favicon.gif
        - favicon.ico
    - quickstart.html
    - sd.html
    - tmp
- error.log
- favicon.gif
- favicon.ico
- get-pip.py
- phpinfo.php
- pylibs
- quickstart.html
- sd.log
- myapp_flask

观察:

  • env/bin/env/include/env/lib/ 都包含看似 Python 版本的内容。
  • env/local/ 包含自己的 bin/include/lib/ 目录,这些目录包含与其他目录完全相同的内容。
  • tmp 包含用于 Apache rails 应用程序的标准 restart.txt。 (注意:touch这样做确实会重新启动服务器,因此此 env/ 目录链接到应用程序本身。

问题:

  • 有人认识这个文件结构吗?它是什么应用程序类型?菲普?导轨?还有什么?
  • 有谁知道我可以在哪里查找包含实际网页的代码?这是一个成熟的实时网页,人们已经使用了一段时间,但我找不到 html(甚至找不到主页)。我已经找了好几天了,所以我知道我做错了。

附加说明:

当我使用 touch tmp/restart.txt/ 重新启动 Web 应用程序时发生此错误

Web application could not be started
An error occurred while starting the web application. It exited before signalling successful startup back to Phusion Passenger. Please read this article for more information about this problem.
Raw process output:
Traceback (most recent call last):
  File "/usr/share/passenger/helper-scripts/wsgi-loader.py",line 26,in <module>
    import sys,os,re,imp,threading,signal,traceback,socket,select,struct,logging,errno
  File "/usr/lib/python2.7/logging/__init__.py",time,cStringIO,warnings,weakref,collections
  File "/usr/lib/python2.7/weakref.py",line 14,in <module>
    from _weakref import (
ImportError: cannot import name _remove_dead_weakref

两个 quickstart.html 内容相同:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>DreamHost</title>
        <link media="all" rel="stylesheet" type="text/css" href="http://dreamhost.com/wp-content/themes/dreamhost/style.css" />
</head>
<body id="domains">
        <div class="w1">
                <div class="w2">
                        <div id="wrapper">
                                <div id="header">
                                        <strong class="comingsoon-logo"><a href="http://www.dreamhost.com/">DreamHost Imagine the Web,Your Way</a></strong>
                                </div>
                                <div class="main" style="padding-bottom: 24px">
                                        <h1>sendsomething.net Coming Soon!</h1>
                                        <div class="holder">
                                                <div class="content">
                                                        <p>The DreamHost customer who owns sendsomething.net has not yet uploaded their website or has chosen to leave this holding page active.</p>
                                                        <p>If you are the owner of this domain,you'll find your login information contained within the emails sent to you when your account was activated. Once logged in,you'll be able to delete this page (quickstart.html) and upload your new site.</p>
                                                        <p>Here are some helpful links for getting started:</p>
                                                        <p>
                                                                <a href="https://panel.dreamhost.com/"><img src="http://images.dreamhost.com/btn-orange-webpanel.png" alt="DreamHost Web Panel" title="DreamHost Web Panel" /></a>
                                                                <a href="http://wiki.dreamhost.com/"><img src="http://images.dreamhost.com/btn-blue-wiki.png" alt="DreamHost Wiki" title="DreamHost Wiki" /></a>
                                                                <a href="http://discussion.dreamhost.com/"><img src="http://images.dreamhost.com/btn-green-discussion.png" alt="DreamHost Discussion Forum" title="DreamHost Discussion Forum" /></a>
                                                        </p>
                                                </div>
                                        </div>
                                </div>
                        </div>
                </div>
        </div>
</body>

感谢您的时间和帮助!

编辑:

根据回答者的要求,以下是~/myapp/myapp_flask/的内容:

- .hg
- .hgignore
- backup_config.ini
- backup_db
- db_backups
- db_repo
- dbmanage.py
- doc
- dump.sql
- example_backup_config.ini
- instance
- migrate_dbs.py
- new.db
- new_bkp.db
- requirements.txt
- restored.db
- restored.dbe
- myapp
    - __init__.py
    - __init__.py.orig
    - __init__.pyc
    - app.py
    - app.pyc
    - forms.py
    - forms.pyc
    - helpers.py
    - helpers.pyc
    - static
    - templates
    - user.py
    - user.pyc
    - views.py
    - views.pyc
- myapp.wsgi
- teste.db
- webfaction.db

解决方法

注意:这可能不是一个完整的答案,但它可能是一个起点。

可能是为了回答您的第一个问题,根据 comments from earlier,这个项目在我看来可能是一个 Flask web application。 Flask 是一个 Python microframework,可用于构建简单或复杂的 Web 应用程序。我猜测这是基于以下观察:

  1. passenger_wsgi.py 文件
  2. 观察评论中以.py made by brombeer结尾的文件
  3. 应用程序结构列表底部名为 myapp_flask 的项目

passenger_wsgi.py 文件而言,Passenger 是一个 web application server,用于运行用 things like Python,Ruby,or Node.js 编写的网络应用程序。

就 brombeer 对文件扩展名的观察而言,以 .py 结尾的文件是 typically Python files

至于那个 myapp_flask 项,如果这个文件或文件夹中有内容,我想知道它是否可能包含主 Web 应用程序代码。是否可以检查该文件或文件夹以查看它是否包含应用程序代码?警告:它可能包含敏感数据(例如,密码、机密或密钥),所以我不知道它是否应该发布在您上面的原始帖子中。

所以,我想我在之前的回复中触及了您的第二个主要问题:您可能能够在 myapp_flask 项中找到主要的 Web 应用程序代码。但是,如果什么都没有,您也许可以通过查看 passenger_wsgi.py 的内容来确定主应用程序代码的位置。

In this example passenger_wsgi.py file 在乘客文档中,它展示了如何在这种类型的文件中引用示例(在这种情况下为 Django)应用程序。如果您在文本编辑器中打开 passenger_wsgi.py,它可能会在包含术语 application =(或类似内容)的行中显示对主应用程序代码的引用,就像前面的示例一样。也许这可以帮助您了解应用程序的名称。

然后,如果 grep 在您的系统上可用,您可以使用 grep 在您的文件结构中搜索应用程序名称。也许使用搜索命令,如:grep -r 'application-name' *。这可能会为您提供有关主应用程序代码所在位置的更多线索。

至于关于您的 ImportError: cannot import name _remove_dead_weakref 错误的附加说明,我不知道它是否与过去的 this other question 类似。但是,在根据其他问题线程中的答案更改与 Python 2 相关的设置之前,我建议谨慎行事,除非您对过程中可能发生的任何事情都满意。我自己还没有尝试过该线程中的答案。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-