在rails app上创建第一个ruby会引发错误

时间:2012-08-26 05:08:14

标签: ruby-on-rails ruby ruby-on-rails-3

我刚开始学习Ruby on Rails。当我尝试从命令行创建我的第一个应用程序时,出现致命错误。我在安装ruby时遇到了一些问题,但现在一切都安装好了。但是,我无法创建应用程序。 这是我得到的错误: -

 ~/workspace/RoR/rails_projects $ rails new first_app
  create  
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  create  app/assets/images/rails.png
  create  app/assets/javascripts/application.js
  create  app/assets/stylesheets/application.css
  create  app/controllers/application_controller.rb
  create  app/helpers/application_helper.rb
  create  app/mailers
  create  app/models
  create  app/views/layouts/application.html.erb
  create  app/mailers/.gitkeep
  create  app/models/.gitkeep
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/secret_token.rb
  create  config/initializers/session_store.rb
  create  config/initializers/wrap_parameters.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  doc
  create  doc/README_FOR_APP
  create  lib
  create  lib/tasks
  create  lib/tasks/.gitkeep
  create  lib/assets
  create  lib/assets/.gitkeep
  create  log
  create  log/.gitkeep
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/index.html
  create  public/robots.txt
  create  script
  create  script/rails
  create  test/fixtures
  create  test/fixtures/.gitkeep
  create  test/functional
  create  test/functional/.gitkeep
  create  test/integration
  create  test/integration/.gitkeep
  create  test/unit
  create  test/unit/.gitkeep
  create  test/performance/browsing_test.rb
  create  test/test_helper.rb
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  create  vendor/assets/javascripts/.gitkeep
  create  vendor/assets/stylesheets
  create  vendor/assets/stylesheets/.gitkeep
  create  vendor/plugins
  create  vendor/plugins/.gitkeep
     run  bundle install
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)
    from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>'
    from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/net/http/persistent.rb:447:in `ssl'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/net/http/persistent.rb:216:in `connection_for'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/fetcher.rb:145:in `fetch'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/fetcher.rb:173:in `fetch_dependency_remote_specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/fetcher.rb:132:in `fetch_remote_specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/fetcher.rb:70:in `specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/source.rb:234:in `block in remote_specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/source.rb:232:in `each'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/source.rb:232:in `remote_specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/source.rb:165:in `fetch_specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/source.rb:70:in `specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:205:in `block (2 levels) in index'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:202:in `each'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:202:in `block in index'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/index.rb:9:in `build'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:198:in `index'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:192:in `resolve'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/definition.rb:122:in `resolve_remotely!'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/installer.rb:48:in `run'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/installer.rb:12:in `install'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/cli.rb:220:in `install'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /usr/share/ruby-rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/bundler-1.1.5/bin/bundle:13: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! 

这是我的安装位置 -

     ~/workspace/RoR/rails_projects $ which ruby
      /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/bin/ruby

     ~/workspace/RoR/rails_projects $ which ruby
    /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/bin/ruby

    ~/workspace/RoR/rails_projects $ which gem
    /usr/share/ruby-rvm/rubies/ruby-1.9.2-p180/bin/gem

我正在使用Linux Mint 12.有人可以帮帮我。 感谢

1 个答案:

答案 0 :(得分:1)

经过一番搜索,我发现this article解决了这个问题。 基本上,错误意味着Ruby不是用openssl编译的。

PS:要在ubuntu-11.10 / linux mint 12上安装Ruby和Rails,This是一篇很好的文章。

认为对任何有同样问题的人都有帮助。