This project is archived and is in readonly mode.
Unable to run rails:update if the app is generated with dev option
-
Arsen7
This bug still exists in January:
** Execute rails:update:javascripts exist public/javascripts rake aborted! wrong number of arguments (1 for 2) ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/generators/rails/app/app_generator.rb:109:in `copy_file' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/generators/rails/app/app_generator.rb:109:in `javascripts' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/generators/app_base.rb:85:in `send' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/generators/app_base.rb:85:in `build' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/generators/rails/app/app_generator.rb:233:in `create_javascript_files' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/tasks/framework.rake:40:in `send' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/tasks/framework.rake:40:in `invoke_from_app_generator' ~/.gem/ruby/1.8/bundler/gems/rails-366e7854ac41/railties/lib/rails/tasks/framework.rake:63 [...]What arguments should be as the second ones in in app_generator.rb? (line ~105)
def javascripts empty_directory "public/javascripts" unless options[:skip_javascript] copy_file "public/javascripts/#{options[:javascript]}.js" copy_file "public/javascripts/#{options[:javascript]}_ujs.js", "public/javascripts/rails.js" if options[:javascript] == "prototype" copy_file "public/javascripts/controls.js" copy_file "public/javascripts/dragdrop.js" copy_file "public/javascripts/effects.js" end end copy_file "public/javascripts/application.js" end -
Arsen7
I lied a little in the rails version, but the bug existed in rails commit 366e7854ac41 (from October) and still exists also in commit a60ea742226f (Jan 10).
-
Arsen7
Looks like the commit 708e09448ba41c45f189c6b1adc989eba8994b20 introduced the problem.
commit 708e09448ba41c45f189c6b1adc989eba8994b20 Author: siong1987 <siong1987@gmail.com> Date: Sat Sep 11 14:09:16 2010 -0500 -j parameter added to rails new command. Now you can start your apps with jquery with rails new myapp -j jquery, the default is still prototype [[#5613](/projects/8994/tickets/5613 "Ticket #5613") state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index 7907191..44f9fde 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -108,12 +108,20 @@ module Rails end def javascripts - unless options[:skip_prototype] - directory "public/javascripts" - else - empty_directory_with_gitkeep "public/javascripts" - create_file "public/javascripts/application.js" + empty_directory "public/javascripts" + + unless options[:skip_javascript] + copy_file "public/javascripts/#{@options[:javascript]}.js" + copy_file "public/javascripts/#{@options[:javascript]}_ujs.js", "public/javascripts/rails.js" + + if options[:prototype] + copy_file "public/javascripts/controls.js" + copy_file "public/javascripts/dragdrop.js" + copy_file "public/javascripts/effects.js" + end end + + copy_file "public/javascripts/application.js" end -
Arsen7
- Assigned user set to Santiago Pastorino
-
Santiago Pastorino
Arsen7 can you provide a patch with tests following steps in http://rails.lighthouseapp.com/projects/8994/sending-patches ?
-
Arsen7
You want me to do some real work, don't you? ;-) Okay, but it will have to wait a few days, as I am currently a little overloaded.
The diff I have sent is not the fix. It's just a quote from the commit 708e09448ba41c45f189c6b1adc989eba8994b20, which introduced the problem, as I believe. The commit cannot be easily reverted, I guess, so I need to understand what and where should be copied, and add the second parameters to all the
copy_filefunctions. -
Santiago Pastorino
- State changed from new to open
- Milestone set to 3.1
-
rails
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale