FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Invalid excape character syntax

 
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users
View previous topic :: View next topic  
Author Message
adamp



Joined: 23 Mar 2009
Posts: 5

PostPosted: Mon Mar 23, 2009 5:34 pm    Post subject: Invalid excape character syntax Reply with quote

I'm brand new to RoR and Netbeans. I've successfully gone through the demos and sample code. When I try to create a project from scratch I and try to do Run/Debug Rake Task -> db:create, I get the following error.


Invalid escape character syntax: /C:\HelloWorld\Rakefile/

C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2058:in `standard_exception_handling': Invalid escape character syntax: /C:\HelloWorld\Rakefile/ (RegexpError)

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2058:in `find'

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2058:in `each'

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2058:in `find'

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2058:in `standard_exception_handling'

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'

from C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31

from C:/ruby/bin/rake:19:in `load'

from C:/ruby/bin/rake:19

I have changed the NetBeans IDE to use the latest ruby 1.8.6_26 release, but that didn't help.

This has to be a
Back to top
View user's profile Send private message
hatakelei
Posted via mailing list.





PostPosted: Tue Mar 24, 2009 6:32 am    Post subject: Invalid excape character syntax Reply with quote

I am in the same boat as you, Adam. New in NetBeans and RoR. I am trying to
create a new RoR and trying to connect to a MS SQL Server database. I tried
to use my existing database connection (which uses JTDS driver). I don't
know this will work or if that is the cause of the error
--
View this message in context: http://www.nabble.com/Invalid-excape-character-syntax-tp22665134p22674878.html
Sent from the NetBeans Ruby Users mailing list archive at Nabble.com.
Back to top
adamp



Joined: 23 Mar 2009
Posts: 5

PostPosted: Tue Mar 24, 2009 6:48 am    Post subject: Reply with quote

I've tried several things including using the RoR distribution and am still stuck.
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Tue Mar 24, 2009 8:57 am    Post subject: Invalid excape character syntax Reply with quote

Can you try whether you can successfully run Rake tasks from the command
line? Assuming you're using the bundled JRuby, open a command prompt for
the project directory and run some Rake task there, e.g.:

C:\YourRailsProjectDir><netbeans install
dir>\ruby2\jruby-1.1.4\bin\jruby -S rake db:create

(Obviously you need to replace <netbeans install dir> with the actual
path to your NB installation).

Erno


adamp wrote:
Quote:
I've tried several things including using the RoR distribution and am still stuck.











Back to top
adamp



Joined: 23 Mar 2009
Posts: 5

PostPosted: Tue Mar 24, 2009 7:15 pm    Post subject: Reply with quote

I tried that and it failed. The error was:

Code:

C:\Documents and Settings\adamp\My Documents\NetBeansProjects\HelloWorld>"C:\Pro
gram Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\jruby" -S rake db:create
(in C:/Documents and Settings/adamp/My Documents/NetBeansProjects/HelloWorld)
Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system`
and try again.


I ran the update as suggested and got the following error:

Code:

C:\Documents and Settings\adamp\My Documents\NetBeansProjects\HelloWorld>"C:\Pro
gram Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\gem" update --system
'"jruby.bat"' is not recognized as an internal or external command,
operable program or batch file.
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Tue Mar 24, 2009 8:32 pm    Post subject: Invalid excape character syntax Reply with quote

So I guess you're using some other Ruby platform than the bundled JRuby
for the app? Could you try running some rake task using the same
interpreter that you have set for the app (you can check the path to the
interpreter from Tools -> Ruby Platforms)?

Erno

adamp wrote:
Quote:
I tried that and it failed. The error was:




Code:


C:\Documents and Settings\adamp\My Documents\NetBeansProjects\HelloWorld>"C:\Pro

gram Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\jruby" -S rake db:create

(in C:/Documents and Settings/adamp/My Documents/NetBeansProjects/HelloWorld)

Rails requires RubyGems >= 1.3.1 (you have 1.2.0). Please `gem update --system`

and try again.







I ran the update as suggested and got the following error:




Code:


C:\Documents and Settings\adamp\My Documents\NetBeansProjects\HelloWorld>"C:\Pro

gram Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\gem" update --system

'"jruby.bat"' is not recognized as an internal or external command,

operable program or batch file.















Back to top
adamp



Joined: 23 Mar 2009
Posts: 5

PostPosted: Tue Mar 24, 2009 9:53 pm    Post subject: Reply with quote

You are correct that I have two ruby installs on my box they are:

Code:

Ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
installed at: C:\ruby\bin


and:

Code:

JRuby 1.8.6 (2008-08-28 patchlevel 114) [java]
C:\Program Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\jruby.bat


Both my project specific Ruby envirnment and the overall Netbean env, as specified in Tools -> Ruby Platforms, point to the "JRuby 1.8.6 (2008-08-28 patchlevel 114) [java]"
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Wed Mar 25, 2009 7:38 pm    Post subject: Invalid excape character syntax Reply with quote

OK; I see. I was asking since the original stack trace you posted
indicated that you use MRI Ruby, not JRuby. Is the error exactly the
same now that you're using JRuby, or is the error now the "Rails
requires RubyGems 1.3.1" one? If the latter, probably the easiest is
to download and install JRuby 1.2.0 (jruby.codehaus.org) which bundles
RubyGems 1.3.1. Please see
http://blogs.sun.com/divas/entry/fixing_the_rails_requires_rubygems for
detailed instructions. Let us know if that helps,

Thanks,
Erno



adamp wrote:
Quote:
You are correct that I have two ruby installs on my box they are:




Code:


Ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

installed at: C:\ruby\bin







and:




Code:


JRuby 1.8.6 (2008-08-28 patchlevel 114) [java]

C:\Program Files\NetBeans 6.5.1\ruby2\jruby-1.1.4\bin\jruby.bat







Both my project specific Ruby envirnment and the overall Netbean env, as specified in Tools -> Ruby Platforms, point to the "JRuby 1.8.6 (2008-08-28 patchlevel 114) [java]"











Back to top
adamp



Joined: 23 Mar 2009
Posts: 5

PostPosted: Thu Mar 26, 2009 6:32 am    Post subject: Reply with quote

OK, I got over the first issue. I switched to using the native ruby environment rather than jruby. I made sure it was all up to date.

I still had the issue, but debugged the rake environment:

1) Right Click <project name> -> Run/Debug Rake Task -> db:create
2) and check "Debug"

Debugging through I found that the system could not find the "mysql" gem at all. Not only could I see it in the debugger, but in debug mode the actual error printed out:

Code:

!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql


I wasn't too stoked to find that the error prints out nicely in debug mode but gives little information in regular run, but whatever. so I did:

Code:
ruby -S gem install mysql


To get the mysql gem installed. I then reran rake db:create and that worked.

Finally I did:

1) Right Click <project name> -> Migrate Database -> To Current Version

And it worked.

I'm now on to routes problems, but I believe those errors being generated between the keyboard and the chair in my development environment.

So in a nut shell, you need to update your jruby install and install the mysql gem.

Thanks for help/pointers.
Adam[/code]
Back to top
View user's profile Send private message
Erno Mononen
Posted via mailing list.





PostPosted: Thu Mar 26, 2009 7:21 am    Post subject: Invalid excape character syntax Reply with quote

Hi Adam,

Great to hear it's working for you now. And thanks for posting your
notes, they will help others running into the same problem.

Cheers,
Erno


adamp wrote:
Quote:
OK, I got over the first issue. It was quite painful, but sort of glad I had the process. First I went through various update paths to get jruby up to date. These are posted here http://blogs.sun.com/divas/entry/fixing_the_rails_requires_rubygems. I also had to update the rails system with:




Code:

Quote:
jruby -S gem install -v=2.3.2 rails






Not sure how rails itself is out of date after a fresh install but whatever. I then found out how to debug the entire Rake process:



1) Right Click <project name> -> Run/Debug Rake Task -> db:create

2) and check "Debug"



Debugging through I found that the system could not find the "mysql" gem at all. Not only could I see it in the debugger, but in debug mode the actual error printed out so I did:




Code:
gem install mysql





To get the mysql gem installed. I then reran rake db:create and that worked.



Finally I did:



1) Right Click <project name> -> Migrate Database -> To Current Version



And it worked.



I'm now on to routes problems, but I believe those errors being generated between the keyboard and the chair in my development environment.



So in a nut shell, you need to update your jruby install and install the mysql gem.



Thanks for help/pointers.

Adam











Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Ruby Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB