0

我决定尝试在我的新笔记本电脑上运行 ruby​​ on rails,因为我已经尝试让它在不太可靠的硬件上运行多次,但出现不同程度的错误。

我通过 RVM 和 Rails 3 安装了 ruby​​ 1.9.2 p320。这是输出rails new blog

...
         run  bundle install
/home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:149:in `fetch'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:177:in `fetch_dependency_remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:135:in `fetch_remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:73:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:234:in `block in remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `each'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:165:in `fetch_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:70:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:191:in `block (2 levels) in index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `each'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `block in index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/index.rb:9:in `build'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:184:in `index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:178:in `resolve'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/bin/bundle:14:in `block in <main>'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/bin/bundle:14:in `<main>'
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 

rake db:create

Could not find gem 'jquery-rails (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.

最后,从捆绑安装:

Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please see the Bundler 
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! 
/home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:149:in `fetch'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:177:in `fetch_dependency_remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:135:in `fetch_remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/fetcher.rb:73:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:234:in `block in remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `each'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:232:in `remote_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:165:in `fetch_specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/source.rb:70:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:191:in `block (2 levels) in index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `each'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:188:in `block in index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/index.rb:9:in `build'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:184:in `index'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:178:in `resolve'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/definition.rb:108:in `resolve_remotely!'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/installer.rb:81:in `run'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/installer.rb:14:in `install'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/cli.rb:230:in `install'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/task.rb:27:in `run'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/invocation.rb:120:in `invoke_task'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor.rb:275:in `dispatch'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/vendor/thor/base.rb:408:in `start'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/bin/bundle:14:in `block in <top (required)>'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/lib/bundler/friendly_errors.rb:4:in `with_friendly_errors'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/gems/bundler-1.2.1/bin/bundle:14:in `<top (required)>'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/bin/bundle:23:in `load'
        from /home/gossfunkel/.rvm/gems/ruby-1.9.2-p320@global/bin/bundle:23:in `<main>'

我显然对 Rails 不是很有经验,所以我不知道发生了什么。这不是我第一次无法以任何方式运行它。

编辑:这是我的 Gemfile,它只是一个默认值:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'
4

1 回答 1

1

看起来 openSSL(至少是开发库)没有安装。

rvm pkg install openssl

rvm pkg install iconv

rvm remove 1.9.2

rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr

或者,您可以sudo apt-get install libssl-dev 重新安装 rvm。

有关更多信息,请参阅:https ://rvm.io/packages/openssl/ & Rails 3 - 没有要加载的文件 - openssl

于 2013-02-03T18:19:18.550 回答