Ubuntu中的Rails Console,Rbenv和Rbenv-Vars问题20.04

发布于 2025-01-23 16:43:56 字数 1070 浏览 2 评论 0原文

我在Ubuntu 20.04中遇到了一个怪异问题。
我已经安装了Ruby 3.1.2,Rails 6.1.5,rbenv和rbenv-vars。
在应用程序目录内设置.rbenv-vars

RAILS_ENV=production
RAILS_MASTER_KEY=123456

每当我尝试Rails Console时,我都会从以下部门开始。

/home/deploy/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.11.1.1.1/lib/lib/loab/load/load_cache_cache/core_core/core_ext/kernel_require_require.rb:27:iin:in `require':无法加载此类文件-Net/pop(loadError)
来自...很多...

我已经测试了Env正在加载,但我无法访问Rails Console。
当我完全删除.rbenv-vars时,我可以运行Rails控制台,但没有Enviroment变量,可以在开发人员而不是生产模式下进行栏杆。
尽管在服务器块内部,我有Passport_App_env生产;

我还没有找到解决方案...有提示吗?

----快速更新----

由于这是我第一次尝试开发&部署Rails应用程序,我认为我以“错误”的方式启动了该项目。 许多月前,该项目在本地开始,直到最近决定将本地(开发)&远程(生产)由于项目发展到确定的水平。 我现在意识到我应该已经开始本地&从一开始。 我偶然发现了生产模式中的许多Bizzare问题,这些问题毫无意义,并且浪费了很多时间进行搜索和研究。

为了使事情务实,我决定将我的应用程序移植到Rails 7(来自Rails 6),并结合了本地(DEV)&一路上远程(Capistrano/生产)。

我目前的状态:到目前为止还不错。 APP在Rails 7解决Rails 7中的问题正在进行中,该问题在Rails 6(ATM:设计)上工作,并且在Digitalocean上进行了直播。

Im experiencing a bizzare issue in ubuntu 20.04.
I've installed ruby 3.1.2, rails 6.1.5, rbenv and rbenv-vars.
Set up inside the app directory the .rbenv-vars with

RAILS_ENV=production
RAILS_MASTER_KEY=123456

Whenever i try rails console i get a bunch of lines starting with:

/home/deploy/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:27:in `require': cannot load such file -- net/pop (LoadError)

from ... lots of froms ...

I have tested that the ENV's are loading but i have no access to rails console.

When i remove the .rbenv-vars completely, i can run rails console but without enviroment variables, railsloads in developer and not production mode.

Although inside the server block i have passport_app_env production;

I haven't found a solution yet... any hints?

---- Quick Update ----

Since it is my first attempt to develop & deploy a Rails app, i think i've started the project in a 'wrong' way.
Many months ago started the project locally and not until recently decided to combine local (development) & remote (production) since the project progressed to an ok level.
My realization now is that I should have started local & remote from the beginning.
I've stumbled into many bizzare issues in production mode which didn't make sense and lost plenty of time searching and researching.

To make things pragmatic i decided to port my app to Rails 7 (from Rails 6) and combine local (dev) & remote (capistrano/production) along the way.

My current status: So far so good. App is progressing in Rails 7 solving issues in Rails 7 where worked on Rails 6 (atm: devise) and it's live on digitalocean.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疯到世界奔溃 2025-01-30 16:43:56

确保rails_master_key具有正确的(原始)值。如果是错误的,您将无法实现此功能。

或者,您可以使用editor =“ nano” rails凭据:edit创建新的主人。

Ensure the RAILS_MASTER_KEY has the right (original) value. If it's wrong, you'll not get this working.

Or you can create new master.key with EDITOR="nano" rails credentials:edit and then save the master.key's value in RAILS_MASTER_KEY

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文