简体   繁体   English

需要构建gemspec并在每次更改gem文件时都安装gem

[英]need to build gemspec and install gem everytime in make a change in gem file

I am creating a custom gem from scratch, and every time i make a change in the gem file, and restart the console, the change is not effective. 我正在从头开始创建自定义gem,并且每次我在gem文件中进行更改并重新启动控制台时,该更改均无效。

I need to build the gemspec and install the gem every time for my changes to be effective, is there any other approach to it that could save some of the time, Thanks. 为了使更改生效,我需要构建gemspec并每次都安装gem,是否有其他方法可以节省一些时间,谢谢。

Yes, it is possible to test your gem functionality without build and install it every time. 是的,无需构建和安装它就可以测试您的gem功能。 Just specify path option in your application Gemfile (not in your gem): 只需在应用程序Gemfile指定path选项(而不是在gem中):

gem 'your gem name', path: 'path to your gem directory'

After that you can just restart application to reload changes in your gem. 之后,您可以重新启动应用程序以重新加载您的gem中的更改。

Here is more details about path option. 是有关path选项的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使响应者gem成为gemspec的依赖项? - Make responders gem a dependency in gemspec? 如何在gemspec文件中指定依赖gem的路径? - how to specify path for dependent gem in gemspec file? Gem .gemspec中的局部依赖性 - Local Dependency in Gem .gemspec 即使gemspec将其添加为运行时依赖项,还是需要在应用程序中需要gem? - need to require gem in the application even though gemspec adds it as a runtime dependency? gem安装typhoeus - 无法构建gem扩展 - gem install typhoeus - failed to build gem extension 如何在.gemspec文件中将本地gem的依赖项添加到rails插件/引擎 - How to add dependency of a local gem to a rails plugin/engine, in .gemspec file 无法安装 gem - 无法构建 gem 本机扩展 - 无法加载此类文件 - mkmf (LoadError) - Unable to install gem - Failed to build gem native extension - cannot load such file -- mkmf (LoadError) gem install rails构建错误无法构建gem本机扩展 - gem install rails build error failed to build gem native extension 将gem依赖项添加到需要git url的gemspec - Adding a gem dependency to gemspec that requires a git url Bundle install导致:Gem :: Ext :: BuildError:错误:无法构建gem原生扩展。 ... make install failed,退出代码2 - Bundle install results in: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. … make install failed, exit code 2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM