rubygems

简介:

A Note Before Beginning

If you made it here after trying to install "fast debugging" or some other feature... the headache that awaits you below is  NOT necessary. ONLY follow the below instructions if you  REALLY, REALLY want to let NetBeans manage your gems. If you only want to use fast debugging or some other absent gem, save yourself the trouble, drop to a command line, and type "sudo gem install ruby-debug-ide" (in the case of fast debugging). If you don't have sudo access, you'll have to su to root. After installing the gem(s) you need, restart NetBeans and you should be good to go.
Now...that said...
You can install Ruby functionality called "gems" using the Ruby Gems Manager from the Tools menu. The feature is described in a bit more detail in the  projects document.

Troubleshooting

You might encounter some problems during the Ruby Gems Manager usage:
  • the Ruby Gems Manager needs to write files into your Ruby installation directory, which is often a privileged directory.
  • on some systems, Ruby does not include RubyGems by default.
Thus, some things can go wrong, and this document attempts to describe some solutions.

RubyGems needs to be installed

Your Ruby installation needs to have the gem command available. If you are using the bundled JRuby installation, that is already the case.
TBD - describe how or put a link to appropriate document.

Permissions problems

You also need to have permission to run the gem command to install, upgrade or uninstall gems. If you have switched to for example /usr/bin/ruby on your Linux box, the gem installation directory is probably not writable without root privileges. NetBeans will inform you of this problem, linking to this wiki page, with the following dialog:

permission_error.png

There are several ways to solve this:
  • Install your own private copy of Ruby somewhere else, and use that instead. Remember not to run the make installation step as root. See below section "Installing your own private copy of Ruby on Ubuntu".
  • Change the write permissions on the gem directory to permissions allowing you to write files there.
Here's an example how  joe  changes the permission of repository in  /var/lib/gems/  (default on Ubuntu BTW), which had root-owned files, to allow him to to run gem without root access:
joe@rubycomp:~$ cd /var/lib/gems/
joe@rubycomp:/var/lib/gems$ sudo chown -fR joe .
[sudo] password for joe:
  • Run NetBeans as root. I don't recommend this approach.
  • Create a private repository for your gems. This will save you the trouble of installing your private copy of Ruby, while keeping your system's security intact.
    TBD - this might be done from within the IDE easily in 6.1, describe how.

Problem with installing Gems which use native extensions

Some  RubyGems  use native extension, i.e. they are (partially) written in C and thus need to be compiled during installation. If you encounter kind of  failed to build native extensions  problems during Gem installation, be sure:
  • that you are not using JRuby interpreter at the moment which cannot build native C extension (there are often counterparts extension written in Java, you might try to find it)
  • you have GCC installed on your Unix-like system (Linux, Mac OS X, ...) so the native compilation is possible.
    • on Mac OS X be sure you have installed Developer Tools. They're not installed by default but they're on the install CD's you get with Leopard.
    • on Ubuntu (7.10 in the time of writing this) following packages need to be installed for compilation. Run:
sudo apt-get install build-essential autoconf
In the case you are using Ruby package from Ubuntu repository, be sure you also install ruby <version>-dev  package, like ruby1.8-dev  or ruby1.9-dev . Otherwise you can't compile any native extensions. E.g.
sudo apt-get install ruby1.8-dev
Please update this Wiki page section for your OS which is not mentioned here yet.

Installing your own private copy of Ruby

Take a look at  this page to see how to install own Ruby on some systems.

Installing FastDebugger on Debian (testing).

Not sure it's the best solution, but you can setup fast debugger in a few simple steps without creating your own gems repository.
Install ruby-debug-ide:
spectator:/$ sudo gem install ruby-debug-ide
Make symbolic link:
spectator:/$ sudo ln -s /var/lib/gems /usr/lib/ruby/gems
That's all! Your NetBeans will detect installed fast debugger and will use it by default.




本文转自 fsjoy1983 51CTO博客,原文链接:http://blog.51cto.com/fsjoy/75752,如需转载请自行联系原作者
目录
相关文章
|
7天前
|
NoSQL Cloud Native Redis
Redis核心开发者的新征程:阿里云与Valkey社区的技术融合与创新
阿里云瑶池数据库团队后续将持续参与Valkey社区,如过往在Redis社区一样耕耘,为开源社区作出持续贡献。
Redis核心开发者的新征程:阿里云与Valkey社区的技术融合与创新
|
7天前
|
关系型数据库 分布式数据库 数据库
PolarDB闪电助攻,《香肠派对》百亿好友关系实现毫秒级查询
PolarDB分布式版助力《香肠派对》实现百亿好友关系20万QPS的毫秒级查询。
PolarDB闪电助攻,《香肠派对》百亿好友关系实现毫秒级查询
|
8天前
|
消息中间件 Cloud Native Serverless
RocketMQ 事件驱动:云时代的事件驱动有啥不同?
本文深入探讨了云时代 EDA 的新内涵及它在云时代再次流行的主要驱动力,包括技术驱动力和商业驱动力,随后重点介绍了 RocketMQ 5.0 推出的子产品 EventBridge,并通过几个云时代事件驱动的典型案例,进一步叙述了云时代事件驱动的常见场景和最佳实践。
115060 1
|
9天前
|
弹性计算 安全 API
访问控制(RAM)|云上安全使用AccessKey的最佳实践
集中管控AK/SK的生命周期,可以极大降低AK/SK管理和使用成本,同时通过加密和轮转的方式,保证AK/SK的安全使用,本次分享为您介绍产品原理,以及具体的使用步骤。
101834 3
|
8天前
|
自然语言处理 Cloud Native Serverless
通义灵码牵手阿里云函数计算 FC ,打造智能编码新体验
近日,通义灵码正式进驻函数计算 FC WebIDE,让使用函数计算产品的开发者在其熟悉的云端集成开发环境中,无需再次登录即可使用通义灵码的智能编程能力,实现开发效率与代码质量的双重提升。
95409 2
|
5天前
|
物联网 PyTorch 测试技术
手把手教你捏一个自己的Agent
Modelscope AgentFabric是一个基于ModelScope-Agent的交互式智能体应用,用于方便地创建针对各种现实应用量身定制智能体,目前已经在生产级别落地。
|
1天前
|
NoSQL Java Redis
使用Redis实例搭建网上商城的商品相关性分析程序
本教程将指导您如何快速创建实例并搭建网上商城的商品相关性分析程序。(ApsaraDB for Redis)是兼容开源Redis协议标准的数据库服务,基于双机热备架构及集群架构,可满足高吞吐、低延迟及弹性变配等业务需求。
17082 0
Doodle Jump — 使用Flutter&Flame开发游戏真不错!
用Flutter&Flame开发游戏是一种什么体验?最近网上冲浪的时候,我偶然发现了一个国外的游戏网站,类似于国内的4399。在浏览时,我遇到了一款经典的小游戏:Doodle Jump...
112747 12
|
13天前
|
SQL 存储 JSON
Flink+Paimon+Hologres 构建实时湖仓数据分析
本文整理自阿里云高级专家喻良,在 Flink Forward Asia 2023 主会场的分享。
71380 1
Flink+Paimon+Hologres 构建实时湖仓数据分析

热门文章

最新文章