pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Ruby on Rails 3?



[ from netbsd-users@ thread http://mail-index.netbsd.org/netbsd-users/2012/10/22/msg011739.html ]

Greg Troxel wrote:
Could you send a note to pkgsrc-users with any hints, and a TODO list of
what ought to be done in pkgsrc (including perhaps promoting wip/node to
www/node (devel/node/??)) to make this easier.  I'd like to see
Diaspora* in pkgsrc, and it needs rails.

Quick answer:
I've now tested the pkgsrc rails setup and the only weak spot seems to be the missing "node" package. So the TODO list should consist only of the point "promoting wip/node to lang/node".

Details:
My setup: fresh install of NetBSD-6.0 xen amd64 domU without x-sets,
# env PKG_PATH=ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.0/All pkg_add pkgin # echo "ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/6.0/All"; > /usr/pkg/etc/pkgin/repositories.conf # pkgin update; pkgin install ruby193-rails-3.2.8; pkgin install ruby-1.9.3p194nb1

At this point it is already possible to use the rails software, the javascript runtime is only needed if you want to use the relevant features of rails. Moreover, pkgsrc includes the SpiderMonkey package (lang/spidermonkey), which provides the needed runtime. It is not autodetected (see https://github.com/sstephenson/execjs/blob/master/lib/execjs/runtimes.rb for details - it is marked as deprecated), but you can use it by setting the EXECJS_RUNTIME environment variable to "SpiderMonkey". The SpiderMonkey is good enough to work with the jQuery 1.8.2 javascript files, which come with rails 3.2.8. I had to install the wip/node in the past because SpiderMonkey was not able to work with some other javascript scripts. That (and the fact, that it is not autodetected, because it is marked as deprecated) leads me to the recommendation regarding the wip/node package.

FYI, my testing went on with the following steps:
Create a rails project "myproject":
$ env GEM_HOME="~/gems" rails new myproject
$ cd myproject
Test the javascript runtime:
$ env GEM_HOME="~/gems" PATH="~/gems/bin:$PATH" RAILS_ENV=production bundle exec rake assets:precompile
- fails
# pkgin install spidermonkey
$ env EXECJS_RUNTIME=SpiderMonkey GEM_HOME="~/gems" PATH="~/gems/bin:$PATH" RAILS_ENV=production bundle exec rake assets:precompile
- success, the file public/assets/application.js is compressed.

Feel free to ask if there is anything unclear. I don't use the rails packages from pkgsrc myself, maybe the author of the packages can also eventually provide additional information.

I am currently using some older version of wip/node (nodejs-0.4.7), I didn't test if the current wip package works with NetBSD - Dima mentioned in the original thread, that it needs some tweaking.

r.


Home | Main Index | Thread Index | Old Index