This project is archived and is in readonly mode.
Error creating Rails 3.0.pre Application
-
Prem Sichanugrist (sikachu)
- Assigned user set to Prem Sichanugrist (sikachu)
Do you still get this problem after update
bundlerto 0.9.4 andrails 3.0.0.beta? -
Conrad Taylor
Prem, everything that I have tried seems to be working using Rails 3.0 beta and Ruby 1.9.1. Also, I guess the debugging code will be removed when Rails 3.0 beta goes to the Release Candidate (RC). Here's what I have tried so far:
$ ruby -v ruby 1.9.1p376 (2009-12-07 revision 26041) [powerpc-darwin9]
$ rails blog $ cd blog $ rails g scaffold post title:string body:text $ rake db:migrate $ rails serverHowever, when using Rails 3.0 beta and Ruby 1.9.2, I'm seeing the following issue when I attempt to perform the migration:
$ ruby -v ruby 1.9.2dev (2010-01-18 trunk 26340) [powerpc-darwin9.8.0] $ rake db:migrate (in /Users/conradwt/rails.dir/examples/blog3) /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:32: warning: already initialized constant RAKEVERSION /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake/alt_system.rb:32: warning: already initialized constant WINDOWS WARNING: Possible conflict with Rake extension: String#ext already exists WARNING: Possible conflict with Rake extension: String#pathmap already exists /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:404: warning: already initialized constant EMPTY_TASK_ARGS /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:452: warning: already initialized constant EMPTY /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:960: warning: already initialized constant RUBY_EXT /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:964: warning: already initialized constant RUBY /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1033: warning: already initialized constant LN_SUPPORTED /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1242: warning: already initialized constant ARRAY_METHODS /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1245: warning: already initialized constant MUST_DEFINE /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1249: warning: already initialized constant MUST_NOT_DEFINE /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1253: warning: already initialized constant SPECIAL_RETURN /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1259: warning: already initialized constant DELEGATING_METHODS /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1569: warning: already initialized constant DEFAULT_IGNORE_PATTERNS /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1575: warning: already initialized constant DEFAULT_IGNORE_PROCS /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1612: warning: already initialized constant FileList /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1638: warning: already initialized constant EARLY /Users/conradwt/.rvm/gems/ruby-head/gems/rake-0.8.7/lib/rake.rb:1968: warning: already initialized constant DEFAULT_RAKEFILES rake aborted! stack level too deep rake aborted! undefined method `find' for "/opt/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383":StringLastly, I'll upgrade Ruby 1.9.2 from the sources and report back with my results.
-
Felipe Rodrigues
I get the same using Ruby 1.9.2 revision 27203.
undefined method
find' for "/opt/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383":String -
Santiago Pastorino
Please try installing the latest version of bundler, then gem cleanup bundler and then bundle install
-
Yehuda Katz (wycats)
- State changed from new to needs-more-info
-
Yehuda Katz (wycats)
- Milestone cleared.
-
Rohit Arondekar
Any new information regarding this ticket?
-
dominic
On windows, bundle_if_dev_or_edge fails because it is setting bundle_command to bundle.exe which should be bundle.bat. Not sure if I should write another ticket for this or not. Here is a possible fix but this pulls in rake. Might want to pull this rake functionality into thor
, --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -4,6 +4,9 @@ require 'rails/version' unless defined?(Rails::VERSION) require 'rbconfig' require 'open-uri' require 'uri' +require 'pathname' +require 'rake/alt_system' +
module Rails module ActionMethods @@ -303,9 +306,11 @@ module Rails
end def bundle_if_dev_or_edge-
bundle_command = File.basename(Thor::Util.ruby_command).sub(/ruby/, 'bundle') -
dir, ruby_command = Pathname.new(Thor::Util.ruby_command).split -
bundle_command = Rake::AltSystem.find_runnable(dir + 'bundle') run "#{bundle_command} install" if dev_or_edge?end +
protected
-
-
Anil Wadghule
dominic, can you share pastie of above code snippet? It's not readable.
-
Rizwan Reza
- No changes were found…
-
dominic
Did you see the included windows.patch file in my above message?
-
bigtoe416
I had this same problem which I could solve by running 'bundle exec bash' and then running rake through that new shell. I was able to make a regular shell work correctly by making sure the environment variables in the bundled bash be the same as a regular shell. You can see your environment variables by running 'env'. I went into my ~/.bash_profile (I think ~/.profile also works if you have that, or maybe ~/.bashrc) and added a couple of export lines and modified my PATH to point to my bundle bin directory.
The exact changes for me were to add the following (this is on a snow leopard box):
export BUNDLE_GEMFILE=/Users//Work/liveops/trunk/Gemfile
export RUBYOPT="-I/usr/local/lib/ruby/gems/1.9.1/gems/bundler-0.9.25/lib -rbundler/setup"
(and then I added this at the very bottom of the file) export PATH="/Users//.bundle/ruby/1.9.1/bin:PATH"Hope that helps somebody.
-
Prem Sichanugrist (sikachu)
I was going to ask about this ticket earlier too, and so tempted to mark as stale.
If anybody still having this problem on RC and the latest bundler, please let me know. Or else I'd have to mark it as invalid.
-
Juanma Cervera
- Tag changed from bundler, rails3 to bundler, rails3, rake
I am using Rails 3.0.0.rc, Ruby-1.9.2-rc2, bundler-1.0.0.rc3 and I am having this error with rake.
I think it is related with the ticket, but maybe better for anotherrake -T --trace (in /home/jmcervera/code_rails3/myapp) /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:30: warning: already initialized constant RAKEVERSION WARNING: Possible conflict with Rake extension: String#ext already exists WARNING: Possible conflict with Rake extension: String#pathmap already exists /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:402: warning: already initialized constant EMPTY_TASK_ARGS /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:450: warning: already initialized constant EMPTY /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:958: warning: already initialized constant RUBY_EXT /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:962: warning: already initialized constant RUBY /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1031: warning: already initialized constant LN_SUPPORTED /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1240: warning: already initialized constant ARRAY_METHODS /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1243: warning: already initialized constant MUST_DEFINE /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1247: warning: already initialized constant MUST_NOT_DEFINE /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1251: warning: already initialized constant SPECIAL_RETURN /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1257: warning: already initialized constant DELEGATING_METHODS /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1561: warning: already initialized constant DEFAULT_IGNORE_PATTERNS /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1567: warning: already initialized constant DEFAULT_IGNORE_PROCS /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1604: warning: already initialized constant FileList /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1630: warning: already initialized constant EARLY /home/jmcervera/.rvm/rubies/ruby-1.9.2-rc2/lib/ruby/1.9.1/rake.rb:1960: warning: already initialized constant DEFAULT_RAKEFILES rake aborted! stack level too deep /home/jmcervera/.rvm/gems/ruby-1.9.2-rc2@rails3/gems/rake-0.8.7/lib/rake.rb:2383I am having this problem in one application but no with others.
This is the Gemfile I am usingsource 'http://rubygems.org' gem 'rails', '3.0.0.rc' #gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'mysql2' #gem "sqlite3-ruby", :require => "sqlite3" # bundler requires these gems in all environments gem 'haml', :git => 'git://github.com/nex3/haml.git' gem 'will_paginate', :git => 'git://github.com/mislav/will_paginate.git', :branch => 'rails3' gem 'formtastic', :git => 'git://github.com/justinfrench/formtastic.git', :branch => 'rails3' gem 'compass', :git => 'git://github.com/chriseppstein/compass.git' gem 'compass-colors' gem 'fancy-buttons' gem 'uuidtools' gem 'show_for', :git => 'git://github.com/plataformatec/show_for.git' gem 'responders' #, :git => 'git://github.com/plataformatec/responders.git' gem 'prawn' #, :git => 'git://github.com/sandal/prawn.git' gem 'json' gem 'pdfkit', :git => 'git://github.com/jdpace/PDFKit.git' group :development do gem 'mongrel', '1.2.0.pre2' gem 'rails3-generators' gem 'wirble' end group :development, :test do gem "rspec-rails", ">= 2.0.0.beta.19" gem "factory_girl_rails" end group :test do gem "autotest-rails" gem "autotest" gem "database_cleaner", :git => 'git://github.com/bmabey/database_cleaner.git' endMaybe I should open another ticket, shouldn't I?
Thanks
-
Juanma Cervera
Please forget my previous comment.
I have resolved my error and has nothing to do with rails, rake, bundle nor ruby-1.9.2.
There was an old rspec.rake file in my lib/tasks folder generating all the troubles.Thanks.
-
Prem Sichanugrist (sikachu)
- State changed from needs-more-info to invalid
Ok, if anybody has problem on creating new rails application in current RC, please open a new ticket. Thank you :)
-
Conrad Taylor
This ticket can be officially closed because I'm no longer experiencing this issue in the current Rails 3.0 RC.
