簡體   English   中英

如何修復“找不到 gem railties 的可執行導軌。railties 當前不包含在捆綁包中”?

[英]How to fix "can't find executable rails for gem railties. railties is not currently included in the bundle"?

當我嘗試通過以下方式啟動服務器時,我的應用程序服務器沒有啟動並給出錯誤:

bundle exec rails server -b 0.0.0.0

Traceback (most recent call last):
    4: from /root/workspace/abl-rest-client_ruby/local/ruby/2.6.0/bin/ruby_executable_hooks:24:in `<main>'
    3: from /root/workspace/abl-rest-client_ruby/local/ruby/2.6.0/bin/ruby_executable_hooks:24:in `eval'
    2: from /usr/local/rvm/gems/ruby-2.6.3/bin/rails:23:in `<main>'
    1: from /usr/local/rvm/gems/ruby-2.6.3/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:480:in `block in replace_bin_path'
    /usr/local/rvm/gems/ruby-2.6.3/gems/bundler-2.0.2/lib/bundler/rubygems_integration.rb:460:in 
   `block in replace_bin_path': can't find executable rails for gem railties. railties is not     
    currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)

我昨天才開始研究 Rails,所以我對整個概念太陌生了。 我了解我缺少 railties gem 的錯誤,但我無法添加它。 我已經嘗試根據這個問題的答案“https://stackoverflow.com/questions/9212116/rails-could-not-find-railties”卸載gem、刪除gem、重新安裝它們等,但沒有任何幫助。

我的 gem 列表有 railties 版本 6.1.0,但我的供應商/緩存沒有它。 我正在使用 windows 進行開發,並且我在 docker 容器內。

我不知道我的供應商/緩存中沒有railties是問題還是我錯過了其他東西。

我已經嘗試了一些解決方案,例如將我的 ruby 版本指定為 rvm

rvm 使用 -myrubyversion,重新啟動捆綁器幾次,等等。

有什么建議么?

確保您的終端位於應用程序的根目錄中,而不是位於其上方的文件夾中。 也就是說,在您運行rails new application_name_here后,輸入cd application_name_here以進入正確的文件夾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM