New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Switcher Hangout The place for switchers to discuss their new machines, and how to work with OS X. General support can be had here for newbie stuff, like "How do I restart my new iMac?" :)

How to change version of Ruby being run in TextWrangler?


Post Reply New Thread Subscribe

 
Thread Tools
saulo

 
Member Since: Feb 12, 2013
Posts: 3
saulo is on a distinguished road

saulo is offline
Hi there..
I am using textwrangler to write ruby scripts, and it goes just fine, except for:
it uses the 1.8.7 version and not the 1.9.3 that i have installed via rvm.

i have read on the TW manual that i should write a "shebang" line pointing to where the new ruby version is,
I type this :
#!/Users/Bus/.rvm/rubies/ruby-1.9.3-p362/bin/irb:16:in `<main>'1.9.3p362
but TW is still using the old version.

Any ideas??

thanks a lot

p
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,815
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
You've got quite the complicated shebang line there. Let's simplify that a bit:
Code:
#!/Users/Bus/.rvm/rubies/ruby-1.9.3-p362/bin/irb

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
saulo

 
Member Since: Feb 12, 2013
Posts: 3
saulo is on a distinguished road

saulo is offline
Quote:
Originally Posted by vansmith View Post
You've got quite the complicated shebang line there. Let's simplify that a bit:
Code:
#!/Users/Bus/.rvm/rubies/ruby-1.9.3-p362/bin/irb
thank you vansmith!
i have made it as you suggested, but still, when further down on my script i type
"puts RUBY_VERSION"
it returns the 1.8.7 old one.

and in fact, i still can't use a method (.force_encoding) wich is only available in the newer ruby version.

thank you!!!
(and apllogizes if i am not following the right way to answer or communicate... i'm totally new to this type of forums.)

p
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,815
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is online now
I'm going to guess that the RUBY_VERSION env variable still returns 1.8.7 because the shebang line doesn't actually change that.

Read p. 227 here.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
saulo

 
Member Since: Feb 12, 2013
Posts: 3
saulo is on a distinguished road

saulo is offline
Quote:
Originally Posted by vansmith View Post
I'm going to guess that the RUBY_VERSION env variable still returns 1.8.7 because the shebang line doesn't actually change that.

Read p. 227 here.
thank you so much...
this is pretty amazing, you answering so quickly :-)

yes... I had read the TW manual before and it states that one should do it that way (with the shebang line)...

what i don't really understand is why, running the script in terminal it accepts the .force_encoding method and returns the new ruby version,
while running it in TW it doesn't accept the method and returns the old version...
it seems to me that that TW it's not really using the new.

any way, thank you very much for you time and attention.

best!

p
QUOTE Thanks

Post Reply New Thread Subscribe


« My posts or threads | CUT pics off MEM CARD instead of COPYING »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Disc Arbitration Maat OS X - Operating System 4 02-08-2012 01:27 PM
Reliable was to get current OS Version in MAC. Marimuthu OS X - Development and Darwin 0 10-18-2011 03:46 AM
Guide: Revert iOS App to Prior Version mayagayam iOS and Apps 0 10-11-2011 02:42 PM
How to change the latest version of Mail to act like it did in 10.3? mynameis OS X - Apps and Games 2 02-04-2006 05:54 PM

All times are GMT -4. The time now is 01:40 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?