You are not logged in.

#1 2010-01-22 22:43:42

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Can't "require builder" for Ruby.

I have not the faintest clue how Ruby and gems work. I'm just trying to compile some software.

The following fails:

require 'rake'
require 'rubygems'
require 'builder'

Complaining that it can't find a file for builder. This is on a fresh install of ruby (1.9.1). What's wrong?

Thanks.

Offline

#2 2010-01-22 23:02:24

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: Can't "require builder" for Ruby.

You need to install the builder gem first:

gem install builder


For more info on using the gem command:

gem help


Since you're using Ruby 1.9 you can also skip the "require 'rubygems'" line, it's no longer required.

Offline

#3 2010-01-22 23:14:18

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: Can't "require builder" for Ruby.

Ah perfect. Thanks.

(Ruby is really weird.)

Offline

#4 2010-01-23 01:20:33

Gigamo
Member
Registered: 2008-01-19
Posts: 394

Re: Can't "require builder" for Ruby.

MTsoul wrote:

Ruby is really weird.

How so? Gems are just a means of easily packaging/distributing libraries and plugins.

Offline

#5 2010-01-23 07:06:49

MTsoul
Member
From: Vancouver, BC
Registered: 2008-08-14
Posts: 95
Website

Re: Can't "require builder" for Ruby.

Well I don't know Ruby at all, so this is just a bunch of things that seem "weird" to me:

- Rake. Why a build system for a scripting language? What's wrong with make/configure/CMake, etc? I guess my gripe here is the fact that I'm trying to compile a Chromium extension, written in javascript, but somehow with a build system in Ruby.

- The fact that it does something at the level with stuff like Rakefiles. It's a general-purpose script, not a specialized utility like make. Make establishes its purpose when people see "makefile" and go "oh I should type make to build this". Is Ruby trying to do this? If it is, why is it a generic scripting language at all? If not, why do this at all?

- Gems are too integrated into Ruby. It'd be a lot nicer if gems (and extensions/plugins) were simply based on how files were placed in the lib directory, and let my package manager worry about what is and how it is distributed. (Like how Python is done on Arch - setuptools is not essential to the operation of things.) And for "gem install builder", why did it not require root access? If it didn't modify a system-file, did it cache something in my local directory or a tmp/var directory? Is that really the right way of doing things? E.g. security concerns.

- It's interpreted, yet the functionality it provides seems low-level enough (compared to PHP anyway) that it should at least have compiled versions. But this isn't really weird I guess, it's more of what Ruby is meant for and I'm not into it enough to appreciate it.

- Trying to get it working on a server?! Holy crap @ the amount of setup and configuration.

But yeah. One thing I'm thankful for is how much popularity Git has gained with Ruby's usage of it.

Offline

#6 2010-01-23 18:50:56

Gigamo
Member
Registered: 2008-01-19
Posts: 394

Re: Can't "require builder" for Ruby.

MTsoul wrote:

Well I don't know Ruby at all, so this is just a bunch of things that seem "weird" to me:

- Rake. Why a build system for a scripting language? What's wrong with make/configure/CMake, etc? I guess my gripe here is the fact that I'm trying to compile a Chromium extension, written in javascript, but somehow with a build system in Ruby.

- The fact that it does something at the level with stuff like Rakefiles. It's a general-purpose script, not a specialized utility like make. Make establishes its purpose when people see "makefile" and go "oh I should type make to build this". Is Ruby trying to do this? If it is, why is it a generic scripting language at all? If not, why do this at all?

- Gems are too integrated into Ruby. It'd be a lot nicer if gems (and extensions/plugins) were simply based on how files were placed in the lib directory, and let my package manager worry about what is and how it is distributed. (Like how Python is done on Arch - setuptools is not essential to the operation of things.) And for "gem install builder", why did it not require root access? If it didn't modify a system-file, did it cache something in my local directory or a tmp/var directory? Is that really the right way of doing things? E.g. security concerns.

- It's interpreted, yet the functionality it provides seems low-level enough (compared to PHP anyway) that it should at least have compiled versions. But this isn't really weird I guess, it's more of what Ruby is meant for and I'm not into it enough to appreciate it.

- Trying to get it working on a server?! Holy crap @ the amount of setup and configuration.

But yeah. One thing I'm thankful for is how much popularity Git has gained with Ruby's usage of it.

1) Ruby is not just a scripting language. It can be used for anything just like for example Python and Perl can, but that does not always make it the best tool for the job.

2) Rakefiles are just a means of automating tedious tasks. For example, you could have a rake task for running all your unit tests. Or for re-generating the documentation of your project. You get the idea, anything is possible.

3) When you install gems as a normal user, they will be installed under ~/.gems. I'm not sure what the concern is here.

4) I'm not sure if I understand what you mean here but anyway: Ruby cannot be compiled. What you are talking about are probably C extensions. It's really easy to integrate a piece of C into Ruby as a library, partly due to the fact Ruby itself is written in C.

5) Are you talking about Rails? Personally I think Rails deployment has become a total breeze with the introduction of Passenger etc.

Offline

Board footer

Powered by FluxBB