2015-05-20 34 views
2

我剛剛進入一個新的項目,我必須學習Ruby。我做了一些教程,一切都很順利。我甚至能夠爲我的新生兒應用程序創建一個Web服務器。
但是,當我導入項目(使用GIT)並試圖運行它時,我發現自己無法啓動WEBrick服務器(使用rails server)。

這是錯誤消息:
Ruby導入項目要求Puma

C:\項目\ BookRosa \ BIN>軌在任何光源
運行bundle install安裝缺少的寶石服務器
找不到彪馬2.9.2。

當我運行捆綁安裝:

C:\Projects\BookRosa\bin>bundle install 
Fetching gem metadata from https://rubygems.org/............ 
Fetching version metadata from https://rubygems.org/... 
Fetching dependency metadata from https://rubygems.org/.. 
Resolving dependencies........ 
Using rake 10.3.2 
Using i18n 0.6.11 
Using minitest 4.7.5 
Using multi_json 1.10.1 
Using thread_safe 0.3.4 
Using tzinfo 0.3.42 
Using activesupport 4.0.3 
Using builder 3.1.4 
Using erubis 2.7.0 
Using rack 1.5.2 
Using rack-test 0.6.2 
Using actionpack 4.0.3 
Using mime-types 1.25.1 
Using polyglot 0.3.5 
Using treetop 1.4.15 
Using mail 2.5.4 
Using actionmailer 4.0.3 
Using arbre 1.0.2 
Using sass 3.2.19 
Using thor 0.19.1 
Using bourbon 3.2.3 
Using coffee-script-source 1.8.0 
Using execjs 2.2.2 
Using coffee-script 2.3.0 
Using railties 4.0.3 
Using coffee-rails 4.0.1 
Using formtastic 3.0.0 
Using formtastic_i18n 0.1.1 
Using has_scope 0.6.0.rc 
Using responders 1.1.2 
Using inherited_resources 1.5.1 
Using jquery-rails 3.1.2 
Using jquery-ui-rails 5.0.2 
Using kaminari 0.16.1 
Using activemodel 4.0.3 
Using activerecord-deprecated_finders 1.0.3 
Using arel 4.0.2 
Using activerecord 4.0.3 
Using bundler 1.10.0.rc 
Using hike 1.2.3 
Using tilt 1.4.1 
Using sprockets 2.11.3 
Using sprockets-rails 2.0.1 
Using rails 4.0.3 
Using polyamorous 1.1.0 
Using ransack 1.5.1 
Using sass-rails 4.0.4 
Using activeadmin 1.0.0.pre from git://github.com/activeadmin/activeadmin.git (a 
t master) 
Using bcrypt 3.1.9 
Using climate_control 0.0.3 
Using cocaine 0.5.4 
Using orm_adapter 0.5.0 
Using warden 1.2.3 
Using devise 3.4.1 
Using devise-i18n 0.11.2 
Using jbuilder 1.5.3 
Using json 1.8.1 
Using paperclip 4.2.0 
with native extensions 
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

C:/Ruby21/bin/ruby.exe extconf.rb 
checking for SSL_CTX_new() in -lssl... no 
checking for SSL_CTX_new() in -lssleay32... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
     --with-opt-dir 
     --without-opt-dir 
     --with-opt-include 
     --without-opt-include=${opt-dir}/include 
     --with-opt-lib 
     --without-opt-lib=${opt-dir}/lib 
     --with-make-prog 
     --without-make-prog 
     --srcdir=. 
     --curdir 
     --ruby=C:/Ruby21/bin/ruby 
     --with-puma_http11-dir 
     --without-puma_http11-dir 
     --with-puma_http11-include 
     --without-puma_http11-include=${puma_http11-dir}/include 
     --with-puma_http11-lib 
     --without-puma_http11-lib=${puma_http11-dir}/lib 
     --with-ssllib 
     --without-ssllib 
     --with-ssleay32lib 
     --without-ssleay32lib 

extconf failed, exit code 1 

Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/puma-2.9.2 
for inspection. 
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/pum 
a-2.9.2/gem_make.out 
An error occurred while installing puma (2.9.2), and Bundler cannot continue. 
Make sure that `gem install puma -v '2.9.2'` succeeds before bundling. 

我都試過http和https源,安裝的devkit,安裝OpenSSL和錯誤不會消失。我不必使用美洲獅,但我也無法取消它。我剛剛創建的應用程序正常工作,所以我沒有IDEIA哪裏出了問題,因爲我是新手,紅寶石

運行gem install puma -v '2.9.2'返回如下:

checking for SSL_CTX_new() in -lssl... 
no checking for SSL_CTX_new() in -lssleay32... 
no *** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. 
Check the mkmf.log file for more details. 
You may need configuration options. 
Provided configuration options: ... 
extconf failed, exit code 1 
+0

你有沒有想過這個?在運行El Capitan的機器上遇到同樣的問題。 –

+0

我所要做的是刪除美洲獅寶石依賴項,並使用內置的rails服務器命令 –

回答

-2

我認爲答案是你的錯誤信息:

An error occurred while installing puma (2.9.2), and Bundler cannot continue. 
Make sure that `gem install puma -v '2.9.2'` succeeds before bundling. 
+0

當我這樣做時,我得到了同樣的錯誤: 檢查SSL_CTX_new()在-lssl ...沒有 檢查SSL_CTX_new( )in -lssleay32 ... no *** extconf.rb失敗*** 由於某種原因無法創建Makefile,可能缺少必要的 庫和/或頭文件。檢查mkmf.log文件以獲取更多詳細信息。您可能需要配置選項 。 提供的配置選項: ... extconf失敗,退出代碼1 –

+0

你確實有一些非常有趣的配置選項正在進行 - 我會檢查那些。 – dax

12

我剛碰到同樣的問題。這issue幫我弄明白了。

我第一次嘗試brew安裝openssl & & brew鏈接 - 強制openssl,但我已經安裝它。

我此修復程序是運行:

gem install puma -v '2.9.2' -- --with-opt-dir=/usr/local/opt/openssl 

希望這對你的作品也是如此。