gpt4 book ai didi

ruby-on-rails - RubyMine 在 Vagrant 机器上列出的 gem 太少

转载 作者:行者123 更新时间:2023-12-04 06:09:59 30 4
gpt4 key购买 nike

我决定在 RubyMine 7.1.4 中使用远程 Ruby SDK。

设置了 Vagrant 机器( hashicorp/precise32 ),RVM、Ruby 2.2.1p85(2015-02-26 修订版 49769)、Rails 4.2.4 和其他所需的 gem 已安装,我的应用程序在由 rails server 启动时运行命令。

远程 Ruby 解释器已按以下方式配置:
Settings > Languages & Frameworks > Ruby SDK and gems > Add > New remote...

  • 类型: Vagrant
  • Ruby 解释器路径:/home/vagrant/.rvm/rubies/ruby-2.2.1/bin/ruby (which ruby 命令的输出)

  • 对于这个远程解释器,RubyMine 中列出的 gem 太少了:
    bundler (1.8.4)
    bundler-unload (1.0.2)
    executable-hooks (1.3.2)
    gem-wrappers (1.2.7)
    minitest (5.4.3)
    power_assert (0.2.2)
    rubygems-bundler (1.4.4)
    rvm (1.11.3.9)
    test-unit (3.0.8)
    gem list打印的实际列表在 SSH 控制台中:
    actionmailer (4.2.4)
    actionpack (4.2.4)
    actionview (4.2.4)
    activeadmin (1.0.0.pre2)
    activejob (4.2.4)
    activemodel (4.2.4)
    activerecord (4.2.4)
    activesupport (4.2.4)
    arbre (1.0.3)
    arel (6.0.3)
    awesome_nested_set (3.0.2)
    bcrypt (3.1.10)
    bigdecimal (1.2.7, 1.2.6)
    binding_of_caller (0.7.2)
    bourbon (4.2.6)
    builder (3.2.2)
    bundler (1.10.6, 1.8.4)
    bundler-unload (1.0.2)
    byebug (6.0.2)
    coffee-rails (4.1.0)
    coffee-script (2.4.1)
    coffee-script-source (1.9.1.1)
    debug_inspector (0.0.2)
    devise (3.5.2)
    erubis (2.7.0)
    execjs (2.6.0)
    executable-hooks (1.3.2)
    formtastic (3.1.3)
    formtastic_i18n (0.4.1)
    gem-wrappers (1.2.7)
    globalid (0.3.6)
    has_scope (0.6.0)
    i18n (0.7.0)
    inherited_resources (1.6.0)
    io-console (0.4.3)
    jbuilder (2.3.2)
    jquery-rails (4.0.5)
    jquery-ui-rails (5.0.5)
    json (1.8.3, 1.8.1)
    kaminari (0.16.3)
    loofah (2.0.3)
    mail (2.6.3)
    mime-types (2.6.2)
    mini_portile (0.6.2)
    minitest (5.8.2, 5.4.3)
    multi_json (1.11.2)
    nokogiri (1.6.6.2)
    orm_adapter (0.5.0)
    polyamorous (1.2.0)
    power_assert (0.2.5, 0.2.2)
    psych (2.0.15, 2.0.8)
    rack (1.6.4)
    rack-test (0.6.3)
    rails (4.2.4)
    rails-deprecated_sanitizer (1.0.3)
    rails-dom-testing (1.0.7)
    rails-html-sanitizer (1.0.2)
    railties (4.2.4)
    rake (10.4.2)
    ransack (1.7.0)
    rdoc (4.2.0)
    responders (2.1.0)
    rubygems-bundler (1.4.4)
    rubygems-update (2.4.8)
    rvm (1.11.3.9)
    sass (3.4.19)
    sass-rails (5.0.4)
    sdoc (0.4.1)
    spring (1.4.0)
    sprockets (3.4.0)
    sprockets-rails (2.3.3)
    sqlite3 (1.3.11)
    test-unit (3.1.5, 3.0.8)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.1)
    turbolinks (2.5.3)
    tzinfo (1.2.2)
    uglifier (2.7.2)
    warden (1.2.3)
    web-console (2.2.1)

    当我尝试在 RubyMine 中运行该应用程序时,它会输出一个错误: No Rails found in SDK .

    如何正确配置解释器?

    最佳答案

    根据 JetBrains RubyMine Confluence :

    When adding an rvm-based remote interpreter, it is important to specify the gem set in the Ruby interpreter path:


    <rvm root>/gems/<gem set>

    您是否尝试过更新解释器路径以反射(reflect)此要求?

    来自问题作者的更新:

    重点是指定 gem 集的路径 而不是 ruby 解释器路径。就我而言,它是: /home/vagrant/.rvm/gems/ruby-2.1.5而解释器的路径是: /home/vagrant/.rvm/rubies/ruby-2.1.5/bin/ruby .

    关于ruby-on-rails - RubyMine 在 Vagrant 机器上列出的 gem 太少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33474731/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com