我知道他们都把宝石放在你的应用程序的不同位置,但似乎捆绑安装 - 部署做得更彻底.我可以将它创建的供应商/包目录添加到版本控制并完成吗?
当我下载某些内容时,gem我希望能够下载gem,然后选择是否要安装它.我问这个是因为我想在多台计算机上安装一个特定的宝石(不需要在每台计算机上安装).
我目前正在升级一个旧的rails应用程序以使用Rails 3和Ruby 1.9.2,而RMagick是我需要安装的最后一个gem.但是,Windows似乎没有任何1.9.2下载,标准的gem安装RMagick也不起作用.
有人能指出我如何安装这个宝石的正确方向吗?
安装了DevKit并重新运行ffi install ....作为输出:
C:\Documents and Settings\******>gem install ffi
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing ffi:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_thread_has_gvl_p()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_ffi_c'" > ffi_c-i386-mingw32.def
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. …Run Code Online (Sandbox Code Playgroud) 我需要在ruby中使用openssl.我该如何安装呢?我已经通过rbenv安装了ruby,并且使用的是ubuntu 12.04.
kprakasam@ubuntu:~$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
kprakasam@ubuntu:~$ irb
irb(main):001:0> require 'openssl'
LoadError: no such file to load -- openssl
from /home/kprakasam/.rbenv/versions/1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/kprakasam/.rbenv/versions/1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from /home/kprakasam/.rbenv/versions/1.9.2-p180/bin/irb:12:in `<main>'
Run Code Online (Sandbox Code Playgroud) 出于好奇......在我以前的帖子Rails3.1引擎中:无法让SLIM或HAML在测试/虚拟应用程序中工作我问在哪里告诉Ruby在我的test/dummy应用程序中使用一些gem .
(显而易见的?)答案就是将它放入我的引擎的Gemfile中.这有效,但它让我有点不舒服,因为在耶胡达卡茨 '后澄清.gemspec和Gemfile的角色他提到......
...在开发gem时,Gemfile"gem的Gemfile应包含Rubygems源和单个gemspec行".
另一方面,在我的Engine的Gemfile(使用Rails生成rails plugin new my_engine)中,有:
# jquery-rails is used by the dummy application
gem "jquery-rails"
Run Code Online (Sandbox Code Playgroud)
所以这似乎是正确的.更新:不,它没有!看下面的答案......
仍然,在StackOverflow上的其他地方我看到解决方案据说只需要所需的宝石config/application.rb,而/sf/ask/361172521/ -into-the-it它被告知要充分利用lib/<your_engine>/engine.rb file.
这是我的想法:为什么test/dummy应用程序不会自动要求.gemspec文件中指定的所有Gems ?我们甚至告诉宝石,哪些宝石用于生产,哪些用于开发模式,明确使用add_dependency和add_development_dependency,所以我没有看到任何理由test/dummy不这样做.
所以这是最后一个问题:我究竟要在哪里告诉Ruby在我的test/dummy应用程序中使用gem ?我不想强迫RUBY在主机APP中使用GEM.
我刚刚开始阅读Michael Hartl撰写的ruby.railstutorial.org一书,并一直在完成第一章.我正在使用mac book OS X,Terminal和Sublime Text.一切都按计划进行,直到测试部署到Heroku为止.我能够连接到Heroku并运行$ git push herokumaster命令.但是部署失败了:
Installing sqlite3 (1.3.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the …Run Code Online (Sandbox Code Playgroud) 当我在OSX Mavericks上运行'gem install cocoapods'时出现错误.
$ gem install cocoapods
ERROR: Could not find a valid gem 'cocoapods' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - bad response backend read error 503 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/cocoapods-0.27.1.gemspec.rz)
ERROR: Possible alternatives: cocoapods
Run Code Online (Sandbox Code Playgroud)
请注意,我可以直接下载cocoapods-0.27.1.gemspec.rz.我正在运行最新版本的XCode(5.0.1)和最新版本的CLI工具.RVM还配置为运行最新的Ruby版本(2.0.0p247)
试图安装Nokogiri我收到以下错误
Maxims-MacBook-Air:ScrapingTheApple maximveksler$ gem install nokogiri
Fetching: nokogiri-1.6.2.1.gem (100%)
Building native extensions. This could take a while...
Building nokogiri using packaged libraries.
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/maximveksler/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
-----
libiconv is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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 …Run Code Online (Sandbox Code Playgroud)