【问题标题】:How to install a Rails application when using RVM?使用 RVM 时如何安装 Rails 应用程序?
【发布时间】:2012-03-23 20:15:14
【问题描述】:

我已按照 this question on SO 的说明设置 RVM、红宝石和宝石列表。

我创建了 rubies 1.8.7 和 1.9.3。对于 ruby​​ 1.8.7,我创建了一个名为 Organisator 的 gemset。

我已激活 1.8.7 ruby​​ 和 gemset“组织者”。

我导航到我的应用程序文件夹并尝试运行 bundle install。我认为这就是我应该安装我的应用程序所需的 gem 的方式,就像我没有 RVM 时一样。

我收到的错误消息:

root@user-VirtualBox:/home/user/RoR/testapp# bundle install
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- openssl (LoadError)
    from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/https.rb:102
    from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /usr/local/rvm/rubies/ruby-1.8.7-p358/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:135:in `fetch'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:163:in `fetch_dependency_remote_specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:122:in `fetch_remote_specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/fetcher.rb:70:in `specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/source.rb:234:in `remote_specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `each'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/source.rb:232:in `remote_specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/source.rb:165:in `fetch_specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/source.rb:70:in `specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/lazy_specification.rb:53:in `__materialize__'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:86:in `materialize'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `map!'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/spec_set.rb:83:in `materialize'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:127:in `specs'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/definition.rb:122:in `resolve_remotely!'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:48:in `run'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/installer.rb:12:in `install'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/cli.rb:220:in `install'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/gems/bundler-1.1.2/bin/bundle:13
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/bin/bundle:19:in `load'
    from /usr/local/rvm/gems/ruby-1.8.7-p358@organizators/bin/bundle:19

我在尝试创建新应用时也收到一条错误消息:

root@user-VirtualBox:/home/user/RoR# rails new testapp
/usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30:in `require': no such file to load -- active_support (LoadError)
    from /usr/lib/ruby/vendor_ruby/railties/lib/rails_generator.rb:30
    from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16:in `require'
    from /usr/lib/ruby/vendor_ruby/railties/bin/rails:16

我认为我在设置 RVM 时做错了什么。 我现在唯一的想法是从我的 gemfile 中安装所有 gem,然后手动将它们添加到 gemfile 中。

版本

  • Ruby 1.8.7-p358
  • Rails 2.3.1.4
  • RVM 1.10.3
  • Ubuntu 11.10

【问题讨论】:

  • rvm list 是否适合您,如果适合,它显示了什么?
  • rvm rubies ruby​​-1.8.7-p358 [i686] ruby​​-1.9.3-p125 [i686]
  • 您可能缺少某些 ssl 包,请参阅:stackoverflow.com/questions/8642368/…
  • rvm在ubuntu上安装时需要用ssl打包。

标签: ruby-on-rails ruby rvm


【解决方案1】:

请使用此处的“快速修复”https://rvm.io/packages/openssl/

您必须忽略其余说明,它们适用于不支持软件包的系统(如 osx)

【讨论】:

    猜你喜欢
    • 2016-01-13
    • 1970-01-01
    • 2011-07-12
    • 2011-04-14
    • 2012-06-25
    • 2017-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多