Rubymine has an error when trying to create a new rails project.
Here is the output after trying to create a new rails project titled 'blog':
/usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /usr/bin/rails _2.3.5_ /home/aaron/RubymineProjects/blog --skip --database=sqlite3
-e:1:in `load': /usr/bin/rails:4: syntax error, unexpected '=', expecting ']' (SyntaxError)
if [ "x$1" = "x" ]; then
^
/usr/bin/rails:4: syntax error, unexpected ']', expecting $end
if [ "x$1" = "x" ]; then
^
from -e:1
Process finished with exit code 1
I haven't done anything with RM yet. I'm really disappointed. This creates a folder under RubymineProjects but thats about it. No code or initial rails stuff. I'm running Ubuntu 9.10 and RM 2.0 that I downloaded today from the site. Is it possible that this is a nightly build and there is a bug? Why on earth is it doing this? If I'm going to purchase this product, I would require that it works out of the box.
Thanks.
请先登录再写评论。
Update: If I create a rails project via command line and open the folder through Rubymine, it looks like it works (I see files... haven't added anything to the project yet) but thats really unacceptable. This needs to be working out-of-the-box.
Hi,
What ruby version do you use? We need this information to try reproduce this.
We've tested creating Rails application with rails 2.3.5 and everything was fine.
Regards,
Oleg
Oleg,
Thanks for the reply. I'm using:
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
Thanks!
Hi,
I've just checked Rails project creation on Ubuntu Karmic 64, ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], rails (2.3.5) and everything worked fine for me.
Do you have only single version of ruby installed on your machine?
Please have a look at rails script itself and ensure it first line points to your ruby1.8 installation.
Regards,
Oleg
Also please create 'empty project' and invoke Tools | Show Gem Environment action.
i have this trouble too
This is my RubyGems Env.
RubyGems Environment:
RUBYGEMS VERSION: 1.3.6
RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
INSTALLATION DIRECTORY: /var/lib/gems/1.8
RUBY EXECUTABLE: /usr/bin/ruby1.8
EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
RUBYGEMS PLATFORMS:
ruby
x86-linux
GEM PATHS:
/var/lib/gems/1.8
/home/dmitry/.gem/ruby/1.8
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:benchmark => false
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
http://rubygems.org/
----------------------
RubyMine SDK Environment:
Sdk: Ruby SDK 1.8.7 (/usr/bin/ruby)
Sdk Version: ver.1.8.7
Ruby Interpreter: /usr/bin/ruby
RVM Sdk: no
Sdk Language Level: 1.8
Sdk Load Path:
/usr/local/lib/site_ruby/1.8
/usr/local/lib/site_ruby/1.8/i486-linux
/usr/local/lib/site_ruby
/usr/lib/ruby/1.8
/usr/lib/ruby/1.8/i486-linux
/home/dmitry/rubymine93.190/rubystubs18
Sdk Gem paths:
file:///home/dmitry/.gem/ruby/1.8/gems
file:///var/lib/gems/1.8/gems
Dmitry,
Please also attach content of a /usr/bin/rails script
syntax error, unexpected '=', expecting ']' (SyntaxError
New RubyMne 2.0.02 install Ubunto 10.04 64 bit
Ruby SDK 1.8.7
Rails 2.3.9 gem installed
Please Help -w e just bought 8 of these licences - works fine for Windows!
Generating Rails Application for module....
usr/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /usr/bin/rails _2.3.9_ /home/broomie/RubymineProjects/NoteBook --skip --database=sqlite3
-e:1:in `load': /usr/bin/rails:4: syntax error, unexpected '=', expecting ']' (SyntaxError)
if [ "x$1" = "x" ]; then
^
/usr/bin/rails:4: syntax error, unexpected ']', expecting $end
if [ "x$1" = "x" ]; then
^
from -e:1
Process finished with exit code 1
Many thanks
Paul
Paul,
Please attach content of a /usr/bin/rails script. We expected that it is a ruby script (as it always is), but seems in your case it is a bash script.
Thanks for being so prompt:
Right here is my rubymine .sh
However it resides in my home (;home/broomie/rubymine93.202/bin directory not usr/bin is this the issue - I think I followed the Rubymine advice on installing for Linux!
Paul
#!/bin/sh
RUBYMINE_JDK=/usr
#
# ------------------------------------------------------
# RubyMine Startup Script for Unix
# ------------------------------------------------------
#
# ---------------------------------------------------------------------
# Before you run RubyMine specify the location of the
# JDK 1.6 installation directory which will be used for running RUBYMINE
# ---------------------------------------------------------------------
if [ -z "$RUBYMINE_JDK" ]; then
RUBYMINE_JDK=$JDK_HOME
if [ -z "$RUBYMINE_JDK" ]; then
echo ERROR: cannot start RubyMine.
echo No JDK found to run RubyMine. Please validate either RUBYMINE_JDK or JDK_HOME points to valid JDK installation
fi
fi
#--------------------------------------------------------------------------
# Ensure the RUBYMINE_HOME var for this script points to the
# home directory where RubyMine is installed on your system.
SCRIPT_LOCATION=$0
# Step through symlinks to find where the script really is
while [ -L $SCRIPT_LOCATION ]; do
SCRIPT_LOCATION=`readlink -e $SCRIPT_LOCATION`
done
RUBYMINE_HOME=`dirname $SCRIPT_LOCATION`/..
RUBYMINE_BIN_HOME=`dirname $SCRIPT_LOCATION`
export JAVA_HOME
export RUBYMINE_HOME
if [ -n "$RUBYMINE_PROPERTIES" ]; then
RUBYMINE_PROPERTIES_PROPERTY=-Didea.properties.file=$RUBYMINE_PROPERTIES
fi
if [ -z "$RUBYMINE_MAIN_CLASS_NAME" ]; then
RUBYMINE_MAIN_CLASS_NAME="com.intellij.idea.Main"
fi
if [ -z "$RUBYMINE_VM_OPTIONS" ]; then
RUBYMINE_VM_OPTIONS="$RUBYMINE_HOME/bin/rubymine.vmoptions"
fi
REQUIRED_JVM_ARGS="-Xbootclasspath/a:../lib/boot.jar -Didea.platform.prefix=Ruby -Didea.no.jre.check=true $RUBYMINE_PROPERTIES_PROPERTY $REQUIRED_JVM_ARGS"
JVM_ARGS=`tr '\n' ' ' < "$RUBYMINE_VM_OPTIONS"`
JVM_ARGS="$JVM_ARGS $REQUIRED_JVM_ARGS"
CLASSPATH=../lib/bootstrap.jar
CLASSPATH=$CLASSPATH:../lib/util.jar
CLASSPATH=$CLASSPATH:../lib/jdom.jar
CLASSPATH=$CLASSPATH:../lib/log4j.jar
CLASSPATH=$CLASSPATH:../lib/extensions.jar
CLASSPATH=$CLASSPATH:../lib/trove4j.jar
CLASSPATH=$CLASSPATH:$RUBYMINE_CLASSPATH
export CLASSPATH
LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
cd "$RUBYMINE_BIN_HOME"
exec $RUBYMINE_JDK/bin/java $JVM_ARGS $RUBYMINE_MAIN_CLASS_NAME $*
Paul,
I asked content of /usr/bin/rails not, rubymine.sh. Obviously problem is in rails script
> /usr/bin/rails:4: syntax error, unexpected '=', expecting ']' (SyntaxError)
Hi there you go
Yes, they changed content of "rails" script. It's not a "ruby" script any more. Please file an issue - http://youtrack.jetbrains.net/issues/RUBY
http://youtrack.jetbrains.net/issue/RUBY-6821