librelist archives

« back to archive

Want to run a gem executable command with jruby 1.9 mode by default

Want to run a gem executable command with jruby 1.9 mode by default

From:
ashbb
Date:
2012-03-23 @ 16:10
Hi all,

I added Rakefile to build the purple_shoes gem file.
The commit is this:

https://github.com/ashbb/purple_shoes/commit/8c7039de4fd4038a683875adc5f2aaec885de9dd

I could build and install the gem file well. But couldn't run the gem
executable command `pshoes`.
I got the following error:

C:\tmp>pshoes -v
SyntaxError:
c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/../lib/pur
ple_shoes.rb:13: syntax error, unexpected ':'

  BASIC_ATTRIBUTES_DEFAULT = {left: 0, top: 0, width: 0, height: 0, angle:
0, cu
rve: 0}
                                  ^
  require at org/jruby/RubyKernel.java:1033
  require at
c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/../lib/pur
ple_shoes.rb:36
   (root) at
c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/pshoes:2
     load at org/jruby/RubyKernel.java:1058
   (root) at c:\jruby\bin\pshoes:19


So, I tried to do the following and it worked well.

C:\tmp>jruby --1.9 -S pshoes -v
0.0.100

Umm,... is there any way to run the gem executable command with jruby 1.9
mode by default?

Regards,
ashbb

Re: [shoes] Want to run a gem executable command with jruby 1.9 mode by default

From:
Tobias Pfeiffer
Date:
2012-03-23 @ 16:45
Hi ash,

you can set an environment variable 

(http://stackoverflow.com/questions/4755900/how-to-make-jruby-1-6-default-to-ruby-1-9)



or for your quick fix:

export JRUBY_OPTS=--1.9


This may also be done in your rvm .rvmrc file.

Oh I just remembered that you are using Windows... so the syntax is:
|set JRUBY_OPTS=--1.9

||cheers,|
|Tobi|
||

On 03/23/2012 05:10 PM, ashbb wrote:
> Hi all,
>
> I added Rakefile to build the purple_shoes gem file.
> The commit is this: 
> 
https://github.com/ashbb/purple_shoes/commit/8c7039de4fd4038a683875adc5f2aaec885de9dd
>
> I could build and install the gem file well. But couldn't run the gem 
> executable command `pshoes`.
> I got the following error:
>
> C:\tmp>pshoes -v
> SyntaxError: 
> c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/../lib/pur
> ple_shoes.rb:13: syntax error, unexpected ':'
>
>   BASIC_ATTRIBUTES_DEFAULT = {left: 0, top: 0, width: 0, height: 0, 
> angle: 0, cu
> rve: 0}
>                                   ^
>   require at org/jruby/RubyKernel.java:1033
>   require at 
> c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/../lib/pur
> ple_shoes.rb:36
>    (root) at 
> c:/jruby/lib/ruby/gems/1.8/gems/purple_shoes-0.0.100/bin/pshoes:2
>      load at org/jruby/RubyKernel.java:1058
>    (root) at c:\jruby\bin\pshoes:19
>
>
> So, I tried to do the following and it worked well.
>
> C:\tmp>jruby --1.9 -S pshoes -v
> 0.0.100
>
> Umm,... is there any way to run the gem executable command with jruby 
> 1.9 mode by default?
>
> Regards,
> ashbb
>

Re: [shoes] Want to run a gem executable command with jruby 1.9 mode by default

From:
ashbb
Date:
2012-03-24 @ 03:02
Hi Tobi,

OHHHH. COOOL!!

Thank you for the information. It works!!

C:\tmp>set JRUBY_OPTS=--1.9

C:\tmp>pshoes -h
Usage: pshoes (options or app.rb)
  -m, -men     Open the built-in English manual.
  -mjp         Open the built-in Japanese manual.
  -v           Display the version info.
  -h           Show this message.

I'll upload purple_shoes gem to RubyGems.org this weekend. :)

ashbb