我知道在使用时gem install,gem将存储在/home/username/.rvm/gems/下,gem下安装gem.
但是如果我使用Bundler并在Gemfile中指定gem,那么当我运行bundle install时,那些gem会被存储在哪里?如果我已经安装了gem gem install,如果我运行bundle install,它会使用之前安装的gem gem install吗?
我在这种情况下发现自己两次:我在我的系统上安装了一个gem并开始在我的Rails项目中使用它.最终我需要对该gem进行一些更改.我该怎么办?
理想情况下,我想查看某个地方的宝石的源代码,比如〜/ third_party/gems,对它进行处理并让我的Rails项目使用它.那可能吗?
在所有情况下,宝石都在github,所以我可能会在github,克隆它,抓住机会并维护我自己的分支.我想我会在我的服务器上直接安装gem分支.那有意义吗?
我需要debugger-linecache一个项目的1.0.1版本,我在尝试安装时遇到以下错误.
trunk ? gem install debugger-linecache -v '1.0.1'
Building native extensions. This could take a while...
ERROR: Error installing debugger-linecache:
ERROR: Failed to build gem native extension.
/Users/jordanscales/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
Makefile creation failed
**************************************************************************
No source for ruby-1.9.3-p194 provided with debugger-ruby_core_source gem.
**************************************************************************
*** 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 …Run Code Online (Sandbox Code Playgroud) 每当我做bundle install所有的宝石安装在
app_dir/vendor/bundle
Run Code Online (Sandbox Code Playgroud)
路径并消耗大量磁盘空间.我也尝试安装宝石,它应该安装,即宝石集,而开发由此:
bundle install --no-deployement
Run Code Online (Sandbox Code Playgroud)
但这对我来说并不适合安装宝石vendor/bundle.如何让它全局安装在所有应用程序或ruby gemsets位置?我也试过删除.bundle/config但没有改变.
我在用:
rvm version: 1.23.14
ruby version: 2.0.0-p247
rails 3.2.13
Run Code Online (Sandbox Code Playgroud)
这是我的~/.bash_profile:
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
eval "$(rbenv init -)"
alias pg='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log'
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
Run Code Online (Sandbox Code Playgroud)
我的~/.bashrc:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
Run Code Online (Sandbox Code Playgroud)
您可能需要的其他一些信息:
aman@Amandeeps-MacBook-Pro …Run Code Online (Sandbox Code Playgroud) 我有一组经常使用的rails视图助手,并希望将它们打包成一个gem,这样我就可以在我的Gemfile中添加一行,并从我的视图中访问帮助器.
我在使用Bundler和Jeweler之前创建了宝石,但是,我并不是很清楚如何在gem中组织Rails视图助手,并将它们包含在rails中.
我将非常感谢任何指针,或链接到有关如何为Rails 3执行此操作的最新教程
谢谢
只是为了澄清:问题不在于"如何创造宝石".它的"如何在gem中打包视图助手,所以我可以在Rails中使用它们"
编辑2:我也同意下面的海报..轨道引擎对于这种(希望简单的)要求太过分了
Linux新手问题我猜...
我怎样才能找到gem在我的Ubuntu 10系统上安装宝石的位置?我想阅读宝石源代码,也许会改变一些东西.
我最近升级到10.10优胜美地测试版,但是我在安装Nokogiri时遇到了麻烦.我正在使用RVM和Ruby 1.9.3.我也按照这里的步骤尝试按照Nokogiri主页上的说明进行操作.
我通过自制程序安装了libxml2(2.9.1)和libxslt(1.1.28),并尝试使用我的Xcode 5安装和Xcode 6 beta中的命令行工具.
gem install nokogiri -v '1.5.5'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/grantdavis/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
checking for libxml/parser.h... *** 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
--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 …Run Code Online (Sandbox Code Playgroud) 我在安装ruby后尝试安装sass,但是我得到以下错误,请帮我解决这个问题
maradhak@WW730VW7X1688 /c/softwares
$ gem -v
2.2.2
maradhak@WW730VW7X1688 /c/softwares
$ gem install sass
ERROR: Could not find a valid gem 'sass' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://rubygems.org/latest_specs.4.8.gz)
Run Code Online (Sandbox Code Playgroud) will_paginate gem在我的Oracle版本上被破坏了.paginate_by_sqlWillPaginate模块中的默认方法是在查询中插入额外的"AS"并使其失败.
代码本身很容易修复,但我不确定让Rails接受我的更改的最佳方法.
我不想更改gem本身的代码,因为这会使我的代码在其他机器上被破坏.
我尝试创建一个包含以下内容的lib/test.rb文件:
module WillPaginate
def paginate_by_sql
(my code goes here)
end
end
Run Code Online (Sandbox Code Playgroud)
并要求它来自environment.rb,但它没有接受我的更改.我也尝试过来自controllers/application.rb,但是再次提到我的更改.
暂时,我通过覆盖特定模型本身的方法来使其工作,但这有点像黑客,并且意味着我不能在该项目中的任何其他模型上使用它.
我确信有一个简单的方法可以做到这一点,但我没有运气跟踪它使用谷歌.
我试图在Windows计算机上安装curb 0.8.0但我似乎无法到达任何地方.我一直在尝试每个网站3页深入我的谷歌搜索.请,任何人都知道如何安装这个单件.我已经下载了curl并将其解压缩到C:\ curl.我已将它添加到我的路径并运行命令:
gem install curb -- --with-curl-lib=C:\curl\bin --with-curl-include=C:\curl\include
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我一直得到同样的错误.有什么建议?