Rails / gem / bundle bug,rails new和rake db:create上的错误

时间:2013-02-03 17:56:31

标签: ruby-on-rails ruby rake bundle

我决定尝试在我的新笔记本电脑上运行的ruby上运行ruby,因为我试图在不太可靠的硬件上运行多次,出现各种程度的错误。

我通过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.

,最后,从bundle install:

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'

1 个答案:

答案 0 :(得分:1)

看起来好像没有安装openSSL(至少是dev库)。

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/&amp; Rails 3 - no such file to load -- openssl

相关问题