草庐IT

GEM_PATH

全部标签

ruby - zsh : command not found: bundle (after gem install bundle)

为什么zsh:commandnotfound:bundle在geminstallbundler之后?我尝试设置path=(/usr/local/lib/ruby/gems/2.2/gems/~/bin/bin/sbin/usr/bin/usr/sbin/usr/local/bin/usr/local/sbin)在/etc/zshrc和source/etc/zshrc中无济于事。root@dev:/home/dev#geminstallbundlerSuccessfullyinstalledbundler-1.7.12Parsingdocumentationforbundler-1.7.

ruby-on-rails - Ruby on Rails,找不到有效的 gem 'rails'

我安装了ruby​​并更新了ruby​​gems,现在我想下载rails3.2.13。我写geminstallrails-v3.2.13(我需要这个版本)我有这个错误ERROR:Couldnotfindavalidgem'rails'(=3.2.13),hereiswhy:Unabletodownloaddatafromhttps://rubygems.org/-SSL_connectSYSCALLreturned=5errno=0state=SSLv2/v3readserverhelloA(https://rubygems.org/specs.4.8.gz)ERROR:Possibl

ruby-on-rails - 如何使用 Rails 2.1 中的 ExceptionNotifier 插件修复 'Unprocessed view path found' 错误?

将Rails1.2网站升级到2.1后,ExceptionNotifierplugin不再有效,提示这个错误:ActionView::TemplateFinder::InvalidViewPath:Unprocessedviewpathfound:"/path/to/appname/vendor/plugins/exception_notification/lib/../views".Setyourviewpathswith#append_view_path,#prepend_view_path,or#view_paths=.是什么原因造成的,我该如何解决?

ruby-on-rails - 在 state_machine gem 上持久化之前的验证

在state_machine中的转换之前执行验证的正确语法是什么?gem?我试过以下,before_transition:apple=>:orangedovalidate:validate_coreenddefvalidate_coreifcore.things.blank?errors.add(:core,'musthaveonething')endend但是我得到以下错误,undefinedmethod`validate'for#我也试过把它写成,state:orangedovalidate:validate_coreend但这会导致记录保存后回滚,不太理想。我想首先阻止状态机转换

ruby-on-rails - 在 IRB 中重新加载 ruby​​gem

有没有办法在内存中“重新加载”或“刷新”rubygem?当我在irb中玩游戏时,偶尔我想修改我的gem文件,如果我需要相同的gem,它不会更新到内存中并给出输出“false”。目前我必须退出IRB,重新进入IRB,然后再次需要gem,必须有更好的方法...它是什么? 最佳答案 正如其他人所建议的,您可以使用Kernel#load。但是,不要浪费时间查找和加载每个gem文件,因为所有需要的文件都存储在$"中。有了这些知识,这里有一个重新加载irb命令:defreload(require_regex)$".grep(/^#{requir

ruby - 以编程方式确定是否安装了某个 gem,如果没有则安装它

这看起来并不难。我想要一个ruby​​脚本来判断某个gem(任何版本,和/或某个版本规范)当前是否安装在系统上(无论gemlist在哪里),如果没有,安装它。是的,我知道在某些情况下,bundler在这方面做得很好。相信我,我有一个案例,出于奇怪的原因我不想使用bundler。我真的很想以编程方式询问本地的gemrepo。当然,一种以编程方式安装的方法就是将shellout到geminstall。但我无法找到一种可靠的方法来以编程方式询问以查看是否安装了特定的gem,而不是使用shellout,不是使用ruby​​gemapi,什么都不是。我错过了吗? 最佳

ruby-on-rails - 为什么 RSpec 的方法 "get"、 "post"、 "put"、 "delete"在 gem(或 Rails 外部)的 Controller 规范中不起作用?

我不是Rails或Rspec的新手,但我是制作gems的新手。当我测试我的Controller时,REST方法“get”、“post”、“put”、“delete”给我一个未定义的方法错误。您将在下面找到代码,但如果您更喜欢在馅饼中查看它,clickhere.谢谢!这是我的spec_helper:$LOAD_PATH.unshift(File.dirname(__FILE__))$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'..','lib'))require'rubygems'require'active_support'u

ruby - 在 Ubuntu 上安装 ruby​​-odbc gem 时出现 "ERROR: sql.h not found"

尝试在Debian/Ubuntu上安装ruby​​-odbcgem会导致以下错误;“错误:找不到sql.h” 最佳答案 这也发生在OSX上,所以brew来拯救:brewinstallunixodbc 关于ruby-在Ubuntu上安装ruby​​-odbcgem时出现"ERROR:sql.hnotfound",我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/17068590/

ruby - 无法在 OS X El Capitan 上安装 thrift gem

在OSXElCapitan升级后尝试安装thiftgem:$geminstallthriftBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingthrift:ERROR:Failedtobuildgemnativeextension./Users/foo/.rvm/rubies/ruby-2.1.4/bin/ruby-r./siteconf20160402-32256-7dzqel.rbextconf.rbcheckingforstrlcpy()instring.h...yescreatingMakef

ruby - 安装 RedCloth-4.2.9 安装 Linux 时无法构建 gem native 扩展

我想在我的电脑上安装Octopress。我试着这样做Octopressdocument.当我运行时bundleinstall我收到错误信息AnerroroccuredwhileinstallingRedCloth(4.2.9),andBundlercannotcontinue.Makesurethat`geminstallRedCloth-v'4.2.9'`succeedsbeforebundling.所以,我跑sudogeminstallRedCloth-v'4.2.9'然后,我又收到一条错误信息:ERROR:ErrorinstallingRedCloth:ERROR:Failedt