I need help getting into console. I could have sworn I did everything right, but on 3 different computers I get the exact same error. C:\rails_apps\test>ruby script/console Loading development environment. c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_re quire'': no such file to load -- ./script/../config/../config/environment (LoadEr ror) from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re quire'' from c:/ruby/lib/ruby/1.8/irb/init.rb:252:in `load_modules'' from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `each'' from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `load_modules'' from c:/ruby/lib/ruby/1.8/irb/init.rb:21:in `setup'' from c:/ruby/lib/ruby/1.8/irb.rb:54:in `start'' from c:/ruby/bin/irb.bat:20 I have ruby 1.8.5 installed on 2 of them and 1.8.6 on the third. I have rails 1.2.3 installed on the 2 that have ruby 1.8.5 and rails 1.2.2 and 1.2.3 installed on the third one. Here are the steps I took to get to this point. 1. downloaded and installed ruby with Windows 1 click installer 2. C:\>gem install rails --include-dependencies 3. C:\>rails test 4. C:\>cd test 5. C:\test>ruby script/console 6. watch the error and cry myself to sleep. Help would be awesome. thanks ~Jeremy -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shouldn''t that be ruby script\console when you''re on windows? (Notice the backslash vs. the regular slash) On 7/21/07, Jeremy Woertink <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I need help getting into console. I could have sworn I did everything > right, but on 3 different computers I get the exact same error. > > C:\rails_apps\test>ruby script/console > Loading development environment. > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_re > quire'': no such file to load -- ./script/../config/../config/environment > (LoadEr > ror) > from > c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re > quire'' > from c:/ruby/lib/ruby/1.8/irb/init.rb:252:in `load_modules'' > from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `each'' > from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `load_modules'' > from c:/ruby/lib/ruby/1.8/irb/init.rb:21:in `setup'' > from c:/ruby/lib/ruby/1.8/irb.rb:54:in `start'' > from c:/ruby/bin/irb.bat:20 > > > I have ruby 1.8.5 installed on 2 of them and 1.8.6 on the third. I have > rails 1.2.3 installed on the 2 that have ruby 1.8.5 and rails 1.2.2 and > 1.2.3 installed on the third one. > > Here are the steps I took to get to this point. > > 1. downloaded and installed ruby with Windows 1 click installer > 2. C:\>gem install rails --include-dependencies > 3. C:\>rails test > 4. C:\>cd test > 5. C:\test>ruby script/console > 6. watch the error and cry myself to sleep. > > Help would be awesome. thanks > > ~Jeremy > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Obie Fernandez http://jroller.com/obie/ Pre-order my book The Rails Way today! http://www.amazon.com/dp/0321445619 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Nope. Windows understands forward slashes. The error says it cant find a file. I''m not sure if this is a truncated backtrace, but it appears to be looking for "environment". As I recall, you have to do some goofing around to get the load paths working right in Windows. Don''t suppose you could just reformat c: with Ubuntu, huh? Just kidding. What happens when you do: ruby script/server ?? On Jul 21, 2007, at 10:20 PM, Obie Fernandez wrote:> > Shouldn''t that be ruby script\console when you''re on windows? (Notice > the backslash vs. the regular slash) > > On 7/21/07, Jeremy Woertink <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> I need help getting into console. I could have sworn I did everything >> right, but on 3 different computers I get the exact same error. >> >> C:\rails_apps\test>ruby script/console >> Loading development environment. >> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in >> `gem_original_re >> quire'': no such file to load -- ./script/../config/../config/ >> environment >> (LoadEr >> ror) >> from >> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re >> quire'' >> from c:/ruby/lib/ruby/1.8/irb/init.rb:252:in `load_modules'' >> from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `each'' >> from c:/ruby/lib/ruby/1.8/irb/init.rb:250:in `load_modules'' >> from c:/ruby/lib/ruby/1.8/irb/init.rb:21:in `setup'' >> from c:/ruby/lib/ruby/1.8/irb.rb:54:in `start'' >> from c:/ruby/bin/irb.bat:20 >> >> >> I have ruby 1.8.5 installed on 2 of them and 1.8.6 on the third. I >> have >> rails 1.2.3 installed on the 2 that have ruby 1.8.5 and rails >> 1.2.2 and >> 1.2.3 installed on the third one. >> >> Here are the steps I took to get to this point. >> >> 1. downloaded and installed ruby with Windows 1 click installer >> 2. C:\>gem install rails --include-dependencies >> 3. C:\>rails test >> 4. C:\>cd test >> 5. C:\test>ruby script/console >> 6. watch the error and cry myself to sleep. >> >> Help would be awesome. thanks >> >> ~Jeremy >> >> -- >> Posted via http://www.ruby-forum.com/. >> >>> >> > > > -- > Obie Fernandez > http://jroller.com/obie/ > > Pre-order my book The Rails Way today! > http://www.amazon.com/dp/0321445619 > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Obie Fernandez wrote:> Shouldn''t that be ruby script\console when you''re on windows? (Notice > the backslash vs. the regular slash) > > On 7/21/07, Jeremy Woertink <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> ror) >> >> 5. C:\test>ruby script/console >> > -- > Obie Fernandez > http://jroller.com/obie/ > > Pre-order my book The Rails Way today! > http://www.amazon.com/dp/0321445619It works either way. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve Ross wrote:> Nope. Windows understands forward slashes. The error says it cant > find a file. I''m not sure if this is a truncated backtrace, but it > appears to be looking for "environment". As I recall, you have to do > some goofing around to get the load paths working right in Windows. > Don''t suppose you could just reformat c: with Ubuntu, huh? Just kidding. > > What happens when you do: > > ruby script/server > > ??script/server runs fine, both with Webrick and Mongrel installed. script/generate works fine also. It is just the script/console. I wouldn''t mind putting Ubuntu on my home computers, but I wouldn''t be able to on my work computer. I convinced the company to let me write a web application in rails because they do EVERYTHING in VB, but I feel hindered by not being able to get into console. One weird thing to note is that is you reassign the value of *path* when it''s value is ./script/../config/../config/environment to "application" then it will continue to load and then kick me into IRB. A friend of mine says he thinks I might be missing a gem, but I installed all the dependencies, I don''t know what other gems to install. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rails version? ruby script/about A bit off topic, what I did on Windows was install cygwin. Is this an option? --s On Jul 22, 2007, at 9:24 AM, Jeremy Woertink wrote:> >> Nope. Windows understands forward slashes. The error says it cant >> find a file. I''m not sure if this is a truncated backtrace, but it >> appears to be looking for "environment". As I recall, you have to do >> some goofing around to get the load paths working right in Windows. >> Don''t suppose you could just reformat c: with Ubuntu, huh? Just >> kidding. >> >> What happens when you do: >> >> ruby script/server >> >> ?? > > script/server runs fine, both with Webrick and Mongrel installed. > script/generate works fine also. It is just the script/console. I > wouldn''t mind putting Ubuntu on my home computers, but I wouldn''t be > able to on my work computer. I convinced the company to let me write a > web application in rails because they do EVERYTHING in VB, but I feel > hindered by not being able to get into console. > > > One weird thing to note is that is you reassign the value of *path* > when > it''s value is ./script/../config/../config/environment to > "application" > then it will continue to load and then kick me into IRB. A friend of > mine says he thinks I might be missing a gem, but I installed all the > dependencies, I don''t know what other gems to install. > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This probably won''t help, but on XP I updated Rails to 1.2.3 and Ruby is at 1.8.5. I created a fresh project, created a database, then a migration and: C:\rails\test\db\migrate>cd ../.. C:\rails\test>rake db:migrate (in C:/rails/test) == CreatePeople: migrating ===================================================-- create_table(:people) -> 0.0500s == CreatePeople: migrated (0.0500s) ========================================== C:\rails\test>ruby script/console Loading development environment. >> p = Person.new => #<Person:0x47ff1d0 @new_record=true, @attributes={"name"=>nil, "address"=>nil }> >> p.name = ''bob'' => "bob" >> p.address = ''123 main street'' => "123 main street" >> p.save => true >> On Jul 22, 2007, at 9:24 AM, Jeremy Woertink wrote:> >> Nope. Windows understands forward slashes. The error says it cant >> find a file. I''m not sure if this is a truncated backtrace, but it >> appears to be looking for "environment". As I recall, you have to do >> some goofing around to get the load paths working right in Windows. >> Don''t suppose you could just reformat c: with Ubuntu, huh? Just >> kidding. >> >> What happens when you do: >> >> ruby script/server >> >> ?? > > script/server runs fine, both with Webrick and Mongrel installed. > script/generate works fine also. It is just the script/console. I > wouldn''t mind putting Ubuntu on my home computers, but I wouldn''t be > able to on my work computer. I convinced the company to let me write a > web application in rails because they do EVERYTHING in VB, but I feel > hindered by not being able to get into console. > > > One weird thing to note is that is you reassign the value of *path* > when > it''s value is ./script/../config/../config/environment to > "application" > then it will continue to load and then kick me into IRB. A friend of > mine says he thinks I might be missing a gem, but I installed all the > dependencies, I don''t know what other gems to install. > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve always used Rails on windows, it works just fine. having run "rails test" you should have a full application tree, c:\test\app \config \test ... if you are in c:\test running ruby "script/console" literally runs the file "c:\test\script\console.rb" that runs #!/usr/bin/env ruby require File.dirname(__FILE__) + ''/../config/boot'' require ''commands/console'' and in turn "c:\test\config\boot.rb" will call environment.rb, and such. so it seems you''re getting past the first bit; how about trying to run the console manually. c:\test\irb irb > require ''config/environment'' this will manually invoke the rails environment. If that doesn''t work, then hopefully it''ll give us some better errors, else it may be something to do with environment variables. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
My Ruby-fu has deserted me this Sunday. I have a plugin that adds a helper to ActionView. This is an abbreviated version of the init code. When it''s included by sending a :include message to ActionView::base, everything works as expected. In tests, however, the "initializing module" is printed when the module is included in the test class, but the class variables are not accessible after that. Anyone have an idea why? (BTW: I''ve clearly misunderstood what''s going on in the base.class_eval stuff. I thought I was adding class variables -- i.e. @@analytics_key -- to whatever class mixed my stuff in, and with ActionView::Base it works.) # the plugin (abbreviated) module GoogleAnalyticsHelper def self.included(base) #nodoc# base.class_eval do puts "initializing module" no_analytics_key_message = ''Add your analytics key with code like GoogleAnalyticsHelper.analytics_key = "ZZ-NNNNNN-N"'' analytics_key = nil analytics_base = <<-EOT <script src="http://www.google-analytics.com/urchin.js", type="text/javascript" /> <script type="text/javascript"> _uacct = "%key%"; urchinTracker(); </script> EOT end end end # the test (abbreviated) require ''test/unit'' require File.dirname(__FILE__) + ''/../lib/google_analytics'' class GoogleAnalyticsTest < Test::Unit::TestCase include GoogleAnalyticsHelper def test_should_raise_exception_when_key_not_set assert_raise {google_analytics} end end --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Matthew Rudy wrote:> I''ve always used Rails on windows, > it works just fine. > > having run "rails test" > you should have a full application tree, > c:\test\app \config \test ... > > if you are in c:\test > running ruby "script/console" > literally runs the file "c:\test\script\console.rb" > > that runs > #!/usr/bin/env ruby > require File.dirname(__FILE__) + ''/../config/boot'' > require ''commands/console'' > > and in turn "c:\test\config\boot.rb" will call environment.rb, > and such. > > so it seems you''re getting past the first bit; > how about trying to run the console manually. > > c:\test\irb > > irb > require ''config/environment'' > > this will manually invoke the rails environment. > If that doesn''t work, then hopefully it''ll give us some better errors, > else it may be something to do with environment variables.Thanks for the information. That was awesome. So it seems going into IRB and require ''config/environment'' works just fine. It returns true and I can do my console stuff. So what now? maybe I need to go through the files. As someone asked earlier about my versions...... I have 3 computers with the same problem. 1. Windows XP PRO, Ruby 1.8.6 rails 1.2.3 2. Windows XP PRO, Ruby 1.8.5 rails 1.2.3 3. Windows XP PRO, Ruby 1.8.5 rails 1.2.2 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It seems so incredibly unlikely that three different systems with different versions of Ruby and of Rails could all be having the same problem. Any chance you could totally remove Ruby and the gems on one machine and install from scratch? I know it''s a pain, but I assure you that a fresh install of Rails does work on Windows. I did just try it. If you really want to dig in and find the bad actor, then maybe you should install ruby-debug and step through the code to see where the settings are wrong. My guess is that scrubbing Ruby and the gems and reinstalling is a better use of your time. --s On Jul 23, 2007, at 10:44 PM, Jeremy Woertink wrote:> > Matthew Rudy wrote: >> I''ve always used Rails on windows, >> it works just fine. >> >> having run "rails test" >> you should have a full application tree, >> c:\test\app \config \test ... >> >> if you are in c:\test >> running ruby "script/console" >> literally runs the file "c:\test\script\console.rb" >> >> that runs >> #!/usr/bin/env ruby >> require File.dirname(__FILE__) + ''/../config/boot'' >> require ''commands/console'' >> >> and in turn "c:\test\config\boot.rb" will call environment.rb, >> and such. >> >> so it seems you''re getting past the first bit; >> how about trying to run the console manually. >> >> c:\test\irb >> >> irb > require ''config/environment'' >> >> this will manually invoke the rails environment. >> If that doesn''t work, then hopefully it''ll give us some better >> errors, >> else it may be something to do with environment variables. > > > Thanks for the information. That was awesome. So it seems going > into IRB > and require ''config/environment'' works just fine. It returns true > and I > can do my console stuff. So what now? maybe I need to go through the > files. As someone asked earlier about my versions...... > > I have 3 computers with the same problem. > > 1. Windows XP PRO, Ruby 1.8.6 rails 1.2.3 > 2. Windows XP PRO, Ruby 1.8.5 rails 1.2.3 > 3. Windows XP PRO, Ruby 1.8.5 rails 1.2.2 > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
to add: C:\rails_apps\test>ruby script/about About your application''s environment Ruby version 1.8.5 (i386-mswin32) RubyGems version 0.9.0 Rails version 1.2.3 Active Record version 1.15.3 Action Pack version 1.13.3 Action Web Service version 1.2.3 Action Mailer version 1.3.3 Active Support version 1.4.2 Application root C:/rails_apps/test Environment development Database adapter mysql Database schema version 1 Here is my boot.rb file http://rafb.net/p/AagJHX25.html It looks fine to me, but in case anyone out there notices anything weird let me know. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Couple of things to try: First.... upgrade to 1.8.6 (or just work with the 1.8.6 machine first. Next... gem update --system (that''s two dashes), This will get you the latest gems. If that doesn''t fix your problem, check file permissions. Ensure that you are either running as an admin, or have granted appropriate rights to yourself to read and execute from c:\ruby and all subfolders, and also ensure you have access to your rails test app. Let me know what you find out. On 7/24/07, Jeremy Woertink <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > to add: > C:\rails_apps\test>ruby script/about > About your application''s environment > Ruby version 1.8.5 (i386-mswin32) > RubyGems version 0.9.0 > Rails version 1.2.3 > Active Record version 1.15.3 > Action Pack version 1.13.3 > Action Web Service version 1.2.3 > Action Mailer version 1.3.3 > Active Support version 1.4.2 > Application root C:/rails_apps/test > Environment development > Database adapter mysql > Database schema version 1 > > Here is my boot.rb file http://rafb.net/p/AagJHX25.html > It looks fine to me, but in case anyone out there notices anything weird > let me know. > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---