This project is archived and is in readonly mode.
"script/* replaced by script/rails" not working
-
Torsten Maul
I can reproduce this problem on my Windows XP box with Rails 3.0.0.beta, but instead of getting an Errno::ENOENT, I am getting an Errn
o::ENOEXEC. Nonetheless there seems to be an issue with the exec() call in file <MY_RUBY_INSTALL>/lib/ruby/gems/1.8/gems/railties-3.0.0.beta/bin/rails on line 2.I was able to fix this by changing the file on line 2 into the following: exec('ruby', Dir.getwd + '/script/rails', *ARGV)
Hope this helps.
-
Fredrik Henne
Torsten Maul's fix works under Ruby 1.8.7, but not using 1.9.1.
Windows-users forced to stay in 1.8.7 then I guess.
-
Matt Hulse
That fix worked for me on WinXP Pro using 1.9.1 RC2 from RubyInstaller.org. For his fix to work, ruby has to be in your path. Instead of 'rails server' from the root of your new rails app, what do you get if you type 'ruby script\rails server'?
-
Fredrik Henne
My bad, the fix indeed works on Windows with Ruby 1.9.1. Though you get problems with invalid .gemspecs (related to Bundler). Mentioned and fixed in http://github.com/carlhuda/bundler/issues/issue/24#issue/24/comment.... Next version of Bundler should fix that.
-
Nick Clarke
Thanks Torsten for the fix.
It seemed to work but I also now get the same issue that Fredrik mentions inc the massive error output.
I'll keep an eye on the Bundler update and will retest once it is released.
-
E. Rider
The fix from Torsten works also for me but with some addition.
In my case, 'ruby' is not the name of my executable. It is ruby18.I've replaced the second line of the file:
exec(Dir.getwd + '/script/rails', *ARGV)with the following which is safer regarding the name of the ruby executable name:
require 'rbconfig'
ruby_exe = Config::CONFIG["ruby_install_name"]
exec(ruby_exe, Dir.getwd + '/script/rails', *ARGV) -
Matt Hulse
Another solution is to replace:
2: exec(Dir.getwd + '/script/rails', *ARGV)
with
2: load(Dir.getwd + '/script/rails')
This solution was posted in the comments of the official beta release announcement by @Trys. At first glance, I didn't think it would work for cases like:
rails generate scaffold log entry:string
because it doesn't explicitly pass the arguments along but it has worked perfectly in every case that I've tried so far.
Using load is definitely a much simpler solution but I'm not sure if it is a better solution than others that have been proposed. Thoughts?
-
José Valim
- State changed from new to resolved
- Assigned user set to Xavier Noria
- Milestone cleared.
Fixed on master.