简体   繁体   English

无法运行rails服务器:`require':无法加载此类文件--net / ssh(LoadError)

[英]Unable to run rails server: `require': cannot load such file — net/ssh (LoadError)

I am trying to learn ruby on rails using the michael hartl guide. 我正在尝试使用michael hartl指南在轨道上学习红宝石。 In the past, I was able to get through the setup of a new rails webapp. 在过去,我能够完成新的rails webapp的设置。 Now, when I try to run the server, I am getting this error: 现在,当我尝试运行服务器时,我收到此错误:

/home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `require': cannot load such file -- net/ssh (LoadError)
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent.rb:1:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent.rb:1:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog.rb:41:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog.rb:41:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `each'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:72:in `block in require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `each'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:61:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler.rb:134:in `require'
    from /home/ss/workspace/hartl/sample_app/config/application.rb:7:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
    from /home/ss/workspace/hartl/sample_app/bin/rails:10:in `require'
    from /home/ss/workspace/hartl/sample_app/bin/rails:10:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `load'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in `call'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
    from /home/ss/.rvm/gems/ruby-2.2.2/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
    from /home/ss/workspace/hartl/sample_app/bin/spring:13:in `require'
    from /home/ss/workspace/hartl/sample_app/bin/spring:13:in `<top (required)>'
    from bin/rails:4:in `load'
    from bin/rails:4:in `<main>'

Alternatively, add this to your Gemfile: 或者,将其添加到您的Gemfile:

gem 'fog', '~> 1.36.0'

and run bundle install . 并运行bundle install This worked for me, because I was hitting a bug introduced in 1.35.0 : https://github.com/fog/fog/issues/3765 这对我1.35.0 ,因为我遇到了1.35.0引入的错误: https//github.com/fog/fog/issues/3765

Add this to your Gemfile: 将其添加到您的Gemfile:

gem 'net-ssh'

and run bundle install after that. 然后运行bundle install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 rails服务器抛出`require&#39;:无法加载这样的文件 - bigdecimal / util(LoadError) - rails server throws `require': cannot load such file — bigdecimal/util (LoadError) `require&#39;:无法加载此类文件-rails / all(LoadError) - `require': cannot load such file — rails/all (LoadError) CarrierWave和Google Cloud Storage错误:“需要”:无法加载此类文件-net / ssh(LoadError) - CarrierWave and Google Cloud Storage error: `require': cannot load such file — net/ssh (LoadError) Rails服务器正常工作,Rails控制台无效。 `require&#39;:无法加载此类文件-捆绑程序/安装程序(LoadError)- - Rails server works, Rails console does not. `require': cannot load such file — bundler/setup (LoadError) - Rails 服务器和 Rails 控制台崩溃:要求&#39;:无法加载此类文件 -- 机架/保护 (LoadError) - Rails server and Rails console crash with: require': cannot load such file -- rack/protection (LoadError) Rails Rspec `require': 无法加载此类文件 -- rails_helper (LoadError) - Rails Rspec `require': cannot load such file -- rails_helper (LoadError) Rails`require&#39;:尝试在本地运行应用程序时无法加载此类文件-mysql2 / mysql2(LoadError) - Rails `require': cannot load such file — mysql2/mysql2 (LoadError) when trying to run an app locally 尝试运行 rspec 时出错:`require&#39;: 无法加载此类文件 — rails_helper (LoadError) - Error when trying to run rspec: `require': cannot load such file — rails_helper (LoadError) &#39;require&#39;: 无法加载此类文件 -- 运行 `rails server` 时出现 &#39;nokogiri\\nokogiri&#39; (LoadError) - 'require': cannot load such file -- 'nokogiri\nokogiri' (LoadError) when running `rails server` Rails 控制台:在“require”中:无法加载此类文件 — readline (LoadError) - Rails console: in `require': cannot load such file — readline (LoadError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM