[Rails] Getting my feet wet on Linux - some questions
So, I'm going to fully go to Linux for both development and production because one) I think it will be simpler down the road and two) I've wanted to learn linux for a long time now. Before I make the leap and turn on my virtualbox and load up the next linux OS, I have a few questions for rails development. 1. What gems "must" I have in order to move from development to production (keeping in mind that I will more than likely 100% duplicate both my development and production environment platforms via my (development = linux/virtualbox and production = linux/VPS(hosted))? .. The list of gems I've been keeping on my "windows" box have been .. Rails + dependencies Capistrano + dependencies Hpricot (for web parsing) Mongrel + dependencies(not sure if I need this) rake-compiler + rake rspec-rails + rspec sqlite3-ruby (1.2.4) mysql (2.7.8 I believe) test-unit version 1.2.3 warbler (for netbeans IDE) 2. I'm going to be using netbeans IDE on linux (because I'm familiar with it and like it). Have there been any issues with netbeans on linux? Anyone encountered any major issues I should be aware of? 3. I want to use the latest ruby version of 1.9.1-p129 on linux. Given the gem listings (and other gems that may not be listed yet for question 1) is this a bad thing to do? I just want to be on the bleeding edge of development and since I'm still learning ruby and rails (I figured the best is always better to start with). Since I now have a VPS for production, I control all areas of installation. 4. Are there any "default applications" like sudo apt-get etc. appliances that I need to have for rails development on a linux box. Can someone list what each app is that I should install and a very tiny summary as to what the app does? Example sudo apt-get coffee (it makes you coffee).. :) 5. What security measures should I work on in linux to protect my environment, especially on my VPS? I'm very fluent with windows security measures but with linux I have absolutely no clue... 6. Lastly, anything else I'm forgetting here? I know it's a long laundry list but I would appreciate it if anyone assisted me with some of the answers. Many thanks in advance! This is a great community (very helpful) and I'm proud to now be a part of it! -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rails Hosting Questions
Update: I did find one review site which is pretty solid: http://www.webhostingjury.com/ It actually listed my current provider #5 which is good but I can definitely confirm that hostgator does not ruby on rails in their mindset... I'm currently talking to Lunarpages to see what type of VPS plans they have since they are listed #1 on the list. Since I'm going to go down the top 3 or 4 I'll just provide updates on what I find out to save someone else some time if they happen to read this. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to delete all records in a table using a link
Colin Law wrote: > I think you want something like > <%= link_to 'Destroy All', :action => 'destroyall', :confirm => 'Are > you sure?', :method => :delete %> > but you might need something in routes as well, I am not sure. > > Colin I'll try out your suggestion. I like the setup because it has the confirmation box and post... -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: why do restful_authentication generated rspec tests fail
Sigh - my apologies - I replied to the wrong post... -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rails Hosting Questions
Hi everyone, I use Hostgator as my hosting provider and I checked out the versions of the apps they are running: Linux CentOS: 5.3 Ruby: 1.8.5 Rails: 2.3.2 MySQL: 5.1.30 I've been programming on a windows box but I do have a virtual linux box setup (not for this particular model) - I wasn't even aware that people still used Ruby 1.8.5.. My current platform for development is: Windows Vista 32 Ruby: 1.9.1-p129 Rails: 2.3.2 MySQL: 5.1.30 Do you think that there will be some problems with my development platform when it goes over to production? What steps do you think I should take (I'm in the process of setting up a vbox for the exact specifications of my host) just in case the host setup doesn't work properly? Is there a better hosting provider than Gatorhost that will work well with Rails that houses the ability for me to setup my own environment? Thanks.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: why do restful_authentication generated rspec tests fail
I'll look into your suggestion - thanks mate. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: How to delete all records in a table using a link
Colin Law wrote: > 2009/6/8 J. D. : >> <%= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm => >> format.xml { head :ok } >> end >> end >> >> I simply want to place a link on one of my pages that when clicked, it >> destroys all of the data inside the table (but not the table or model >> itself) and then redirects back to the main page which is >> @rushing_offenses. >> > > Are you sure that is a good idea? What will happen when google > follows the link? It might be better as a post rather then a get. > > Colin Hi Colin, I'm just going to be using it for my development platform. I simply want a link so that I can quickly remove all data in a particular table and then be able to re-populate it with some new data.. Can you provide me with a way to do that? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] How to delete all records in a table using a link
I've been looking around and can't seem to find something that shows how to do this.. My controller is rushing_offenses_controller.rb My model is rushing_offense.rb I'd like to use something similar but I'm not all that familiar with REST. <%= link_to 'Destroy All', @rushing_offenses.all.destroy!, :confirm => 'Are you sure?', :method => :delete %> I have a method in my controller called destroyall which does: def destroyall @rushing_offense = RushingOffense.find(:all) @rushing_offense.destroy respond_to do |format| format.html { redirect_to(rushing_offenses_url) } format.xml { head :ok } end end I simply want to place a link on one of my pages that when clicked, it destroys all of the data inside the table (but not the table or model itself) and then redirects back to the main page which is @rushing_offenses. Thanks. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Okay, The end result was modifying the model for the table I was working with to do the following: class RushingOffense < ActiveRecord::Base def scrape offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata start_date = Time.now.beginning_of_week end_date = Time.now.end_of_week current_date = Time.now @rushing_offenses = RushingOffense.find(:all, :conditions => ['compiled_on > ? and compiled_on < ?', start_date, end_date]) if @rushing_offenses == [] #means we have an empty array for i in 0..offensive_rushing.numrows-1 puts "Updating Offensive Rushing Statistics for #{offensive_rushing.rows[i][1]}." RushingOffense.create(:rank => offensive_rushing.rows[i][0], :name => offensive_rushing.rows[i][1], :games => offensive_rushing.rows[i][2], :carries => offensive_rushing.rows[i][3], :net => offensive_rushing.rows[i][4], :avg => offensive_rushing.rows[i][5], :tds => offensive_rushing.rows[i][6], :ydspg => offensive_rushing.rows[i][7], :wins => offensive_rushing.rows[i][8], :losses => offensive_rushing.rows[i][9], :ties => offensive_rushing.rows[i][10], :compiled_on => current_date) end end if @rushing_offenses != [] #means the current week's data is not empty puts "Current Week's Data Is Already Populated!" end end end This code works 100% and doesn't overlap. However, if you could take a look at this code and let me know if there's something I should change to make it "better" or follow "best practices" to shorten or make it more efficient, I would be appreciative. I feel great now having completed my first difficult action with rails. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Frederick Cheung wrote: > On Jun 8, 5:11�am, "J. D." wrote: >> have to figure out how to check whether or not it returns nil and create >> data.. > > It will never return nil. It will return an array (possibly an empty > one). You might want to set your own timestamp and use that rather > than relying on created at (so that the date is one that is > significant to your data and not just when you happened to run your > scraper) > > Fred Hi Fred, Yep you were correct. If the query is empty it returns an empty array [] so I'll make some checks against that. I'll also take your advice and create a new column called compiled_on and associate it to timestamp. Thanks. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Hi Fred, I think I will use this for my find parameter: start_date = Time.now.beginning_of_week end_date = Time.now.end_of_week @rushing_offenses = RushingOffense.find(:all, :conditions => ['created_at > ? and created_at < ?', start_date, end_date]) That will let me find anything created within the set week. Now I just have to figure out how to check whether or not it returns nil and create data.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
By the way Fred, I really do appreciate you taking the time to help me and isolate some of my issues. I want to be proactive with my own code and later on with helping others. My goal is to gain an understanding of best practice methods and start utilizing those methods in my code from the start. I want to do whatever it is I need to do to get things going. If you say I need to go to X site (I'll go to X site), etc. I'm very focused at the task at hand. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Frederick Cheung wrote: > > Sounds like you shouldn't be using update_all at all here, rather you > should be using find to find an appropriate row to update and if there > is none, create a new one. > > Fred Again, the problem is I don't know how. I'm simply guessing based on what I see with the documentation. I don't have any working examples and most of the tutorials I see are very basic.. How I plan to manage the data is important as well. For instance, I want to keep weekly data snapshots. So, as an example just using the rushing offense table: A user will be able to check by a particular week (the cron job will run the rake task once per week) Therefore, my database table needs to account for "new data" every single week. Scenario: Rake Task begins Check for weekly snapshot data (for current week) -- If no snapshot data then create it -- If data already exists for current week do nothing Next Week Rake Task begins Check for weekly snapshot data (for current week) -- If no snapshot data then create it -- If data already exists for current week do nothing So, let's look at my current table structure: :rank :name :games :carries :net :avg :tds :ydspg :wins :losses :ties So, the first issue I see is that I do not have a column that accounts for some type of weekly snapshot event notification. Would you recommend this be tied to a timestamp? How would I check (based on the conditions above) to check against a particular timestamp range and produce the results..? Or should I create another column to check this out? And, lastly, is there somewhere online that code is available to view for "advanced table manipulation"? Much of the code that I have found is either very outdated, very basic, or not something I can use. The documentation is a decent start but it does not contain a lot of advanced examples.. I know I may be asking a lot of questions (and I apologize if I am). However, I do learn quickly and I'm the type of person that likes to dive in and get started. I've read one full ruby book and am midway through my first rails book. However, even these books do not provide me scenario based examples. This is why I'm here. I am better at understanding code when I see code. I don't mind working through code that contains errors and trying to get it to work. That just helps me gain an understanding of what occurs. The API can only be used as a code bits reference. I always look there first but which code are you looking for? If you know exactly what method you are going to be working with, looking in the API and then scouring the web for information is a little easier. In the case of my example above, I'm not sure which methods I will be working with exactly to accomplish my task. Thanks. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Hi Fred, Yeah I'm stuck with this one. I've checked the documentation but I'm just not following it. What I basically need it to do is to update the table with the data that's parsed into @rows. In this case @rows is listed by: offensive_rushing.rows[i][1] (:name) offensive_rushing.rows[i][2] (:games) I was trying to do a for loop to go through all of the rows and send the new data to the database. I'm just not sure how to do it properly. I catch on quick but I've been searching the web and reading the documentation and I just don't see a very detailed model for what I'm trying to do. So, in a readability format what I see is: for i in 0..offensive_rushing.numrows-1 --> starting my loop and it's going to repeat approx 120 times (120 teams) puts "Updating Team Name = #{offensive_rushing.rows[i][1]}." --> Print me out an update to show me that you are updating the teams RushingOffense.update_all(:name => offensive_rushing.rows[i][1], :games => offensive_rushing.rows[i][2]) --> Update the :name with the name of the team --> Update the :games with the number of games that team has played --> Update it if the team already exists (not sure how to do this part) --> Add new data if the team doesn't exist (don't know how to do this part) I hope that helps.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Frederick Cheung wrote: > > Does Scraper need to be an activerecord class at all ? you could pass > to it the class whose table needs to be updated ie > > def do_something(some_klass) > some_klass.update_all(...) > end > > or perhaps you might want to couple things a little more loosely > > def do_something(some_klass) > some_klass.handle_scraper_data(...) > end > > Fred Hi Fred: Here's what I managed to do on my own (believe it or not - lol ): My Rake Task: Basically calling the RushingOffense class from models desc "Parse Rushing Offenses data from ncaa.org" task :parse_rushing_offenses => :environment do update_rushing = RushingOffense.new update_rushing.scrape end My Model for Rushing Offense: Which basically I created a method for "scrape" to scrape data utilizing the Scraper class. Since this model has inheritance with ActiveRecord it should be able to update... class RushingOffense < ActiveRecord::Base def scrape offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata for i in 0..offensive_rushing.numrows-1 puts "Updating Team Name = #{offensive_rushing.rows[i][1]}." RushingOffense.update_all(:name => offensive_rushing.rows[i][1], :games => offensive_rushing.rows[i][2]) end end end Then finally, I have my scraper.rb file #== Scraper Version 1.0 # #*Created By:* _Elricstorm_ # # _Special thanks to Soledad Penades for his initial parse idea which I worked with to create the Scraper program. # His article is located at http://www.iterasi.net/openviewer.aspx?sqrlitid=wd5wiad-hkgk93aw8zidbw_ # require 'hpricot' require 'open-uri' # This class is used to parse and collect data out of an html element class Scraper #< ActiveRecord::Base #class Scraper attr_accessor :url, :element_type, :clsname, :childsearch, :doc, :numrows, :rows # Define what the url is, what element type and class name we want to parse and open the url. def initialize(url, element_type, clsname, childsearch) @url = url @element_type = element_type @clsname = clsname @childsearch = childsearch @doc = Hpricot(open(url)) @numrows = numrows @rows = rows end # Scrape data based on the type of element, its class name, and define the child element that contains our data def scrape_data @rows = [] (doc/"#...@element_type}.#{@clsname...@childsearch}").each do |row| cells = [] (row/"td").each do |cell| if (cell/" span.s").length > 0 values = (cell/"span.s").inner_html.split('').collect{ |str| pair = str.strip.split('=').collect{|val| val.strip} Hash[pair[0], pair[1]] } if(values.length==1) cells << cell.inner_text.strip else cells << values.strip end elsif cells << cell.inner_text.strip end end @rows << cells end @rows.shift # Shifting removes the row containing the table header elements. @rows.delete([]) # Remove any empty rows in our array of arrays. @numrows = @rows.length end def clean_celldata @ro...@numrows-1][0] = 120 end # Print a joined list by row to see our results def print_values puts "Number of rows = #{numrows}." for i in 0...@numrows-1 puts @rows[i].join(', ') end end end Now the only problem I have now is when I run the rake task, I don't get any errors and I see the puts for each team as it's being updated (or supposed to be updated). So, it's counting each row as I expected. I only tried to update 2 fields just for a test.. but no data is being listed in the database.. Any ideas of what I might be doing wrong? This still has been a great day because even though I've seen tons of errors, I'm learning.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
I think I found my own answer to the last question - a single class cannot inherit across multiple classes. :( -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
Another thing I considered is inheritance. If I do class Scraper < RushingOffenses then the RushingOffenses class located in the rushing_offense.rb model would inherit it. Then I could possibly put the following in my rake task: offensive_rushing = RushingOffense::Scraper.new However, I would want Scraper to be a part of every statistical class I create. So, it would have to be a member of: RushingOffense PassingOffense ScoringOffense etc... How would I force inheritance across multiple classes? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
To add another thought to the mix: The only reason why I'm defining a rake task is that eventually the rake task will be managed by a cron job for populating the data for my database on a weekly basis (say every sunday night). The main bulk of the remainder of my project will just be dealing with controllers and views for how the site is listed.. So, the population of data from an external source is the big issue right now. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ActiveRecord Classes
To expand upon the issue: There are approximately 37 different categories for College Football that house statistics. I will be parsing 37 different URLs to pull and retrieve data that will be pushed to my database. The Scraper class is the tool for doing that. Each call within my rake task is going to call specific URLs using the methods located in the Scraper class but will update to specific table names. Example: rushing_offense.rb ---> connects to the rushing_offenses table passing_offense.rb ---> connects to the passing_offenses table scoring_offense.rb ---> connects to the scoring_offenses table Call to scraper.rb to parse data from a rushing offense URL Call to scraper.rb to update data to rushing_offenses table Call to scraper.rb to parse data from a passing offense URL Call to scraper.rb to update data to passing_offenses table Call to scraper.rb to parse data from a scoring offense URl Call to scraper.rb to update data to scoring_offenses table etc. etc. -- for 37 different categories -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ActiveRecord Classes
I'm having a little trouble with understanding how to work out the schematic for some of my classes using ActiveRecord when a file is in my lib directory: Brief example: Here's the outline of the files in use: app controllers application_controller.rb rushing_offenses_controller.rb models rushing_offense.rb lib scraper.rb tasks scraper.rake The rushing_offense.rb file contains: class RushingOffense < ActiveRecord::Base end The scraper.rb file contains: class Scraper < ActiveRecord::Base # METHOD that define which URL to parse # METHOD that parses the data into an instanced variable called @rows # METHOD that should be updating my database table called "rushing_offenses" # Update Rushing Offense def update_rushing_offense for i in 0...@numrows-1 update_all(:name => @rows[i][0], :games => @rows[i][1]) puts "Updating Team Name = #...@rows[i][0]}." end end end The scraper.rake file contains: desc "This task will parse data from ncaa.org and upload the data to our db" task :scraper => :environment do offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata offensive_rushing.print_values offensive_rushing.update_rushing_offense # the call to the method above end Now if I run the rake file what is going to happen is I'm going to get an error stating: Table 'project_development.scrapers' doesn't exist: I believe I understand why that's happening but I'm not sure how to fix it from a long term perspective. Here's why... The class Scraper is pushed into the ActiveRecord::Base so it believes the class is the pluralized name of the table Scrapers. I then thought well maybe I need to put the code in the rushing_offenses_controller.rb file in that class but here's the issue I'm having: The Scraper class should be a class that I can call with other classes to do repetitive tasks on many different URLs. I've setup the class to do that with the methods being able to retrieve different URLs. So, I want my Scraper class to just act like a utility class to be used by other classes to parse data, and upload it to the correct database table. If I place the scraper class inside the rushing_offenses_controller file then I'm not following DRY principles. I don't want to have to repeat code over and over. Any ideas on how I can rectify this issue I'm having? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rake Tasks
Thanks - I understand that part now! I put scraper.rb in my Libs folder I put scraper.rake in my libs/tasks I took the end portion of scraper.rb and removed it placing it in my rake file: desc "This task will parse data from ncaa.org and upload the data to our db" task :scraper => :environment do # In our search we are supplying the website url to parse, the type of element (ex: table), the class name of that element # and the child element that contains the data we wish to retrieve. offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata offensive_rushing.print_values end And it did a print out when I called the rake.. So, now I'll have to test this with the database and see how it works... Thanks a ton (I understand it now).. The part that was => environment do was telling my rake task to make sure that the environment was fully loaded before running it. So, if I wanted to run another rake task in the same rake file and I wanted to make sure the first was done, I'd do something like: task: next_task => :scraper do # code end which would make it run only after the scraper task had finished.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rake Tasks
Frederick Cheung wrote: > On Jun 7, 1:40�pm, "J. D." wrote: >> include anything to call that .rb file? �I'm sorry if I am >> misunderstanding this portion of the mechanics. >> >> > Because your task depends on :environment Rails is loaded, in > particular its dependency management is loaded so it will find your > Scraper class as long as it's in scraper.rb somewhere on its search > path. Don't take my word for it though, try it! > > Fred Thanks, I'll test a couple of generic variables and puts... -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rake Tasks
Maurício Linhares wrote: > This custom file should be called scraper.rb and should be placed at > the /lib folder of your application. In a rake task you don't really > access or call controllers, you just run the task, which is telling > the scrapper to load the data and then save it to the DB. > So, just to make sure I understand correctly.. The scraper.rb file would go in the lib folder and my scraper.rake file would go in the lib\tasks folder? The rake file - would I have to include anything to call that .rb file? I'm sorry if I am misunderstanding this portion of the mechanics. > > You don't need to do anything else, Rails will automatically enable > rubygems and by requiring hpricot you will tell it to load the gem. > Thanks - that part is easy enough. When I go to port my app to my real site, I will have to install hpricot there as well? Or, can I include hpricot in vendor\plugins? > > Now you have to learn the Rails database access framework, > ActiveRecord, you should probably find plenty of material about it. > This is the part that I'm currently studying/reading on and it's wonderful thus far. I just didn't know if the rake task or the ruby file had to communicate with activerecord in a certain way.. i.e. - When I have a controller created it can communicate through the model and access the database. Since the rake and rb file are not part of MVC, I just didn't know if it also used similar mechanics or not. Thanks for the feedback. I'll wait for the reply on the first note to figure it out.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Commands out of sync
It sounds like you are trying to run two commands at the same time and your first command hasn't closed the session.. In otherwords, trying to open more than one session without closing the first... -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rake Tasks
Hi Everyone, I just need some further help clarifying a custom rake task I'm building and the logistics of how it should be working. I've created a custom rake task in libs/tasks called scraper.rake which so far just contains the following: desc "This task will parse data from ncaa.org and upload the data to our db" task :scraper => :environment do # code goes here for scraping end This rake task will be parsing data from ncaa.org and placing it into my DB for further processing. The .rb file I created has the following: === #== Scraper Version 1.0 # #*Created By:* _Elricstorm_ # # _Special thanks to Soledad Penades for his initial parse idea which I worked with to create the Scraper program. # His article is located at http://www.iterasi.net/openviewer.aspx?sqrlitid=wd5wiad-hkgk93aw8zidbw_ # require 'hpricot' require 'open-uri' # This class is used to parse and collect data out of an html element class Scraper attr_accessor :url, :element_type, :clsname, :childsearch, :doc, :numrows # Define what the url is, what element type and class name we want to parse and open the url. def initialize(url, element_type, clsname, childsearch) @url = url @element_type = element_type @clsname = clsname @childsearch = childsearch @doc = Hpricot(open(url)) @numrows = numrows end # Scrape data based on the type of element, its class name, and define the child element that contains our data def scrape_data @rows = [] (doc/"#...@element_type}.#{@clsname...@childsearch}").each do |row| cells = [] (row/"td").each do |cell| if (cell/" span.s").length > 0 values = (cell/"span.s").inner_html.split('').collect{ |str| pair = str.strip.split('=').collect{|val| val.strip} Hash[pair[0], pair[1]] } if(values.length==1) cells << cell.inner_text.strip else cells << values.strip end elsif cells << cell.inner_text.strip end end @rows << cells end @rows.shift # Shifting removes the row containing the table header elements. @rows.delete([]) # Remove any empty rows in our array of arrays. @numrows = @rows.length end def clean_celldata @ro...@numrows-1][0] = 120 end # Print a joined list by row to see our results def print_values puts "Number of rows = #{numrows}." for i in 0...@numrows-1 puts @rows[i].join(', ') end end end # In our search we are supplying the website url to parse, the type of element (ex: table), the class name of that element # and the child element that contains the data we wish to retrieve. offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata offensive_rushing.print_values If you tested that out, you will see a print out of 120 rows of data.. What I want to do is to utilize the .rb file I created with my rake task. However, I'm not sure how to incorporate that into rails. Once I get past this hurdle it should help with future issues. So, here are my list of questions in order of what I am curious to know.. 1. Where do custom .rb files go inside of my rails project? (for instance I understand the MVC but with a rake task - in my brain it's outside of the project and I'm not sure how it is supposed to communicate with controllers or pull/associate variables from those areas. 2. With my custom .rb I'm also requiring 'hpricot'. Is there anything special I need to do with a .rake file to make sure that it knows to pull this gem? And, if I export to my real site, how do I ensure that hpricot is loaded there too? In otherwords, what expectations should I be relying on? 3. When I run a rake task and need to communicate with my database (for uploading purposes) is there an easy way to do this? Can I utilize .rake with my DB inside of my rails environment? Or, are rake tasks completely seperate and distinct and need to be considered outside of scope? 4. Can anyone provide me a summarized step by step (nothing too fancy or that takes up too much of your own time) with how "you" would accomplish this kind of rake task given a similar .rb and .rake file? What generalized steps would you take? Create a class? (if so, where would you place it) How would you communicate with the DB within rails? etc. I know these are a lot of questions but I figure even if one or two of them get answered, I'm happy. You don't have to feel that you can't reply if you don't have the answers to all of them. Any answers that can be touched upon would be greatly appreciated. I am a newbie and learning rails (but many books do not talk about these particulars). So, I'm relying on others that have patience and
[Rails] Re: Scaffolding question
Thanks for the information. I have a dual-developing platform (windows and linux) but my host is on linux.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Scaffolding question
Thanks again Mauricio, I will look into trying this out. Is the rake task able to be defined periodically by a weekday? For instance, if I want the job to only pull data on a Monday (is that feasible)? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Scaffolding question
Maurício Linhares wrote: > The "integer", "string" and "float" methods are just shorthands for > the column call using that type. > > It's also the "new way" (new since Rails 2, not that new now) of > writing migrations. And the "timestamps" will create both a created_at > and also an updated_at column. > > - > Maur�cio Linhares > http://alinhavado.wordpress.com/ (pt-br) | > http://codeshooter.wordpress.com/ (en) Thanks Mauricio - I actually like it better than having to do things a long way. Anything shorter is better, IMO. I appreciate the explanation. I have one more question.. I've created a ruby program that actually parses raw statistics from the main NCAA web site, which I want to bring into my own database. So, using the example above.. here's an example of the parser I created: #== Scraper Version 1.0 # #*Created By:* _Elricstorm_ # # _Special thanks to Soledad Penades for his initial parse idea which I worked with to create the Scraper program. # His article is located at http://www.iterasi.net/openviewer.aspx?sqrlitid=wd5wiad-hkgk93aw8zidbw_ # require 'hpricot' require 'open-uri' # This class is used to parse and collect data out of an html element class Scraper attr_accessor :url, :element_type, :clsname, :childsearch, :doc, :numrows # Define what the url is, what element type and class name we want to parse and open the url. def initialize(url, element_type, clsname, childsearch) @url = url @element_type = element_type @clsname = clsname @childsearch = childsearch @doc = Hpricot(open(url)) @numrows = numrows end # Scrape data based on the type of element, its class name, and define the child element that contains our data def scrape_data @rows = [] (doc/"#...@element_type}.#{@clsname...@childsearch}").each do |row| cells = [] (row/"td").each do |cell| if (cell/" span.s").length > 0 values = (cell/"span.s").inner_html.split('').collect{ |str| pair = str.strip.split('=').collect{|val| val.strip} Hash[pair[0], pair[1]] } if(values.length==1) cells << cell.inner_text.strip else cells << values.strip end elsif cells << cell.inner_text.strip end end @rows << cells end @rows.shift # Shifting removes the row containing the table header elements. @rows.delete([]) # Remove any empty rows in our array of arrays. @numrows = @rows.length end def clean_celldata @ro...@numrows-1][0] = 120 end # Print a joined list by row to see our results def print_values puts "Number of rows = #{numrows}." for i in 0...@numrows-1 puts @rows[i].join(', ') end end # This method will be used to further process collected data def process_values File.open("testdata.txt", "w") do |f| for i in 0...@numrows-1 f.puts @rows[i].join(', ') end end puts "Processing completed." end end # In our search we are supplying the website url to parse, the type of element (ex: table), the class name of that element # and the child element that contains the data we wish to retrieve. offensive_rushing = Scraper.new('http://web1.ncaa.org/mfb/natlRank.jsp?year=2008&rpt=IA_teamrush&site=org', 'table', 'statstable', '//tr') offensive_rushing.scrape_data offensive_rushing.clean_celldata offensive_rushing.print_values offensive_rushing.process_values - So, the other question I have is how do I tie in the mechanics of a regular ruby program into rails? For instance, the ruby program I wrote requires hpricot.. I just need a bit of guidance (I catch on fast).. Someone can run the program I included to see how it outputs.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Scaffolding question
The first scaffold table should look like this: (not what I posted) class CreateRushingOffenses < ActiveRecord::Migration def self.up create_table :rushing_offenses do |t| t.string :name t.integer :games t.integer :carries t.integer :net t.float :avg t.integer :tds t.float :ydspg t.integer :wins t.integer :losses t.integer :ties t.timestamps end end def self.down drop_table :rushing_offenses end end -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Scaffolding question
I'm starting to get involved with models in rails and so I need to make sure I understand exactly what I'm trying to do. Let's look at a quick example: One table that I will be creating is a rushing_offense table for football. It has the following columns in the tables: name (string) games (fixnum) carries (fixnum) net (fixnum) avg (float) tds (fixnum) ydspg (float) wins (fixnum) losses (fixnum) ties (fixnum) When I create the scaffold and setup the hash pairs the migration that is created appears like this: class CreateRushingOffenses < ActiveRecord::Migration def self.up create_table :rushing_offenses do |t| t.string :name t.fixnum :games t.fixnum :carries t.fixnum :net t.float :avg t.fixnum :tds t.float :ydspg t.fixnum :wins t.fixnum :losses t.fixnum :ties t.timestamps end end def self.down drop_table :rushing_offenses end end The question I have is regarding the column name. I've looked at some other migration templates (namely those in the authentication system) and for the users model/migration, it shows something along the lines of: class CreateUsers < ActiveRecord::Migration def self.up create_table "users", :force => true do |t| t.column :login, :string, :limit => 40 t.column :name, :string, :limit => 100, :default => '', :null => true t.column :email, :string, :limit => 100 t.column :crypted_password, :string, :limit => 40 t.column :salt, :string, :limit => 40 t.column :created_at,:datetime t.column :updated_at,:datetime t.column :remember_token,:string, :limit => 40 t.column :remember_token_expires_at, :datetime end add_index :users, :login, :unique => true end def self.down drop_table "users" end end So, should my migration be showing t.column instead of t.type? I'm not clear on the differences between this or how I would dictate with the generator that a column should be forced (or even if it's necessary). Many thanks in advance. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rspec Controller Generator
Marnen Laibow-Koser wrote: > if NetBeans is expecting a particular setup that's no longer > accurate, then it's actually hurting your productivity, not helping it. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org It wasn't hurting me - I just didn't realize some of the extra steps I needed to do. Netbeans is really a great IDE (and I've tried a lot of them). I stayed with netbeans because it created the least amount of problems for me. In this particular case the issue was not to automatically download the generator file but to just copy the correct gems into the plugins directory so that they were up to date. After I did this, everything is working flawlessly and no more issues. Keep in mind that I'm using Ruby 1.9.1-p129 with Windows Vista so there's always a ton of issues present with that install platform right now. Luckily, I've gotten past all of the hoops and hurdles. I have mysql, sqlite3 installed (those were the toughest to get installed using this platform). I have the latest rails and now my rspec is up to date and working properly. So, I feel one more step closer to virtual bliss.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rspec Controller Generator
Okay I figured it out - thanks to your direction! I uninstalled rspec_generator gem (very outdated) I copied rspec and rspec-rails to the vendor/plugins directory and now netbeans IDE sees the correct generators. If anyone else has this same issue - that's the fix. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rspec Controller Generator
Marnen Laibow-Koser wrote: > J. D. wrote: >> I'm using Ruby 1.9.1-p129 on Windows >> Rails 2.3.2 >> I have Rspec and Rspec_generator and use Netbeans 6.5 IDE.. > > Rspec_generator? What's that? I've never heard of it. > >> >> When I try to generate Rspec Controller, everything works except for the >> final view which errors out because it says it's looking for view.rhtml > [...] > > I use RSpec on all my projects, and I can assure you that this is not > normal behavior. Perhaps you're using an older version of rspec-rails > that doesn't know about current template naming conventions. Try > upgrading your RSpec installation. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org Hi Marnen, I really appreciate you responding to my post. On my system I have the following gems: rspec (0.5.15) rspec_generator (0.5.15) I use netbeans IDE and so it helps automating some of the tasks while using rails. When I want to create an Rspec Controller by generating it through netbeans, if a generator is not installed with netbeans, I can select a generator and it installs the gem for that piece. I didn't even have rspec-rails so I just did a gem install for that and now I see: rspec (1.2.6, 0.5.15) rspec-rails (1.2.6) rspec_generator (0.5.15) .. so it appears I had an older version of rspec and didn't realise that. I didn't even have rspec-rails installed. I'll have to test it out again through netbeans to see if it works. If it does not then I believe the issue is with the netbeans IDE using an older gem to generate rspec controllers. I'll test it shortly and post back with what I find out. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Rspec Controller Generator
Yes, that is the issue. The Netbeans IDE 6.5 interface which I use to generate Rspec controllers uses a gem called rspec_generator which is outdated and uses the old format (which makes sense considering the version numbers match the "old" version numbers). I'll try to find a newer version of that gem somewhere that matches 1.2.6 so that the IDE works properly again. Many thanks! -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Rspec Controller Generator
I'm using Ruby 1.9.1-p129 on Windows Rails 2.3.2 I have Rspec and Rspec_generator and use Netbeans 6.5 IDE.. When I try to generate Rspec Controller, everything works except for the final view which errors out because it says it's looking for view.rhtml ..in.. C:\Ruby\lib\ruby\gems\1.9.1\gems\rails-2.3.2\lib\rails_generator\generators\components\controller\templates ..which.. won't work because that contains view.html.erb which is the new format So, to bypass that error I've been running Rspec Controller generator and then I follow it with generating a normal Controller which appears to work. The question I have is does this create any potential issues? Is there another workaround that is better to use? Many thanks. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Updated Tutorials?
Philip Hallstrom wrote: >> Are there any tutorials out there that work for rails 2.3.2 that I can >> follow along with and where? I'd love to learn more about the model >> transitioning with databases.. I've learned a great deal already but >> I'm missing tutorials that interact with databases. > > http://guides.rubyonrails.org/ Thanks Philip -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Updated Tutorials?
Summary: Every book I've purchased has either been a) outdated using rails 1.x or b) outdated using rails 2.x where there are issues working through some of the books. A good example is a book that others said was wonderful. It's called Foundation Rails 2. I started going through the book and everything is being taught the exact way I like to learn. So, I'm thinking "alright this is great!". Then, I get to the first partial tutorial involving "clients". I'm supposed to add the unfinished clients (that I downloaded) and work from that. I download it, place it in my projects directory, fire up netbeans 6.5 and add it and encounter a rake error. I try to get more information so I drop down into a command prompt and run rake -D on the directory called Clients and receive the following error: rake aborted! undefined method 'new!' for Rational:Class C:/Ruby/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in 'raw_load_rakefile' I spent hours finally getting both mysql and sqlite3 up and running on 1.9.1 on a windows environment and I'm able to create new projects in either DB platform on rails using netbeans 6.5. However, it seems that every tutorial I find (other than the 10-minute weblog tutorial for netbeans) has failed or is outdated and contains errors. I wouldn't be bothered by this so much if it wasn't for the fact that I've paid money for these books and many of them have some nice concepts but nothing to work with or through. So, my frustration is not with rails and it's ever changing environment. It's that people are selling books that are stating they work fine with rails 2.x and they aren't. Are there any tutorials out there that work for rails 2.3.2 that I can follow along with and where? I'd love to learn more about the model transitioning with databases.. I've learned a great deal already but I'm missing tutorials that interact with databases. Many thanks in advance. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Everything is working well. I did the 10-minute weblog project for rails and it worked nicely. I'm finally excited that everything appears to be installed and working correctly. Thanks again for the help! -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Maurício Linhares wrote: > Try this - http://www.netbeans.org/kb/trails/ruby.html > > - > Maur�cio Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ > (en) > > On Sat, May 30, 2009 at 12:26 PM, J. D. Thanks! Looks good - reading it now. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Mauricio, Thanks for the input with netbeans. I actually installed netbeans and tried to configure with jruby but had a lot of issues with trying to get jruby to work well with a test project. However, when I used netbeans with my current 1.9.1 and created a test project, rake created the DB, and then ran it through netbeans, it worked 100%. I like the feel of netbeans so I must thank you for giving me that heads up. I'll try to go back to jruby at a later date when I can understand it a bit more but netbeans is working well with my current source and because I installed it, I realized I needed warbler (so downloaded that gem). I'd like to know what gems I'm missing now that I should try to install. I have all of the ones listed above and including warbler now... Any other gems I'm missing? And, is there a good netbeans tutorial that anyone can point me to? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Maurício Linhares wrote: > Pre-packaged version? > > JRuby is just a pure ruby interpreter writen in Java that is faster > than the current 1.8 branch and is almost as fast as 1.9. And IDEs > shoudn't really care about which Ruby version you're using, at least > NetBeans and RubyMine don't, maybe it's time for you to change your > tools. > > JRuby also has a compatibility mode to run as if it was a Ruby 1.9 > interpreter, you should research and use it before making your mind. I will download and test Jruby to see how it functions firsthand. I'm not overly worried about deploying to a 1.9 environment right this minute. I just want to work with 1.9 locally, develop my apps locally, view them and test them locally. Once I feel comfortable with all of that (perhaps a few months down the road) I'll worry about the deployment phase then. Programming in the latest environment is critical to my way of thinking. I learn the latest and am not backtracking and having to adjust. Because I'm new to rails, in my opinion it is better to start with the latest version. When you say not supported you really mean not supported by some gem developers. 1.9.1 works fine on both windows and linux. Some gems though, do not. I've spoken with Luis about this and he's given me a lot of information as to why gems are not working properly, and I understand the frustrations firsthand. I'm really not here to argue or create issues at all. I'm generally a very helpful person, love assisting others, and am the type that will give to the community more than I take. However, I'm still learning the ropes so if you see any teeth in my comments (they are not meant for you). It is simply me dealing with the many frustrations of trying to get up and running. Again, I still need the other questions answered. If someone has answers to those questions, I would greatly appreciate it. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Jruby is not for me - it looks more like a pre-packaged version that is not 1.9.1 and researching it (many say it's slow). I need an IDE that is going to work with 1.9.1. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Ruby and RoR Setup Frustrations
Maurício Linhares wrote: > Have you tried to use JRuby? > > I'm sure you're not going to have any of these problems on Windows. > > - > Maur�cio Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ > (en) I'll look into jruby but I still need answers to the rest of my questions, namely what gems I will need on windows with mysql for a full rails environment to work. Developing is one thing but I will eventually have to port the app to my hosting domain and so I need to make sure I have everything I need setup properly. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Would ROR be a good choice to build my site?
Jack Jackson wrote: > Would ROR be a good choice to build my site? > > Hi Gang, > > I'm in the process of developing a social media-ish site built around > WordPress and VBulletin forum. A site where a visitor has a username and > password and their own "page" on the site where various site > interactions take place. I need a CMS framework to tie them all together > along with other features like multimedia, video uploading/severing/, > news/articles/information as well as user/visitor created content ala/ > wiki's. I'll need a user-friendly backend to control the functionality. > (aside from Wordpress and VBulletin's existing backends) > Would ROR be suited for this sort of development? I'm going to be hiring > a developer very soon and would like to have some honest opinions from > those that know the platforms best. My current direction has me leaning > toward Joomla or Drupal but I've heard so much about ROR lately, I want > to find out more about it and if it's the best choice for my project. > > I hope to hear some good opinions. Thanks. I'm new here, especially with rails - but understanding the MVC concepts I would distinctly say "no". A CMS system tied around Vbulletin will not work with rails because vbulletin was never designed with MVC in mind. It would not mesh well with rails mainly because of the following: 1) It's PHP and not MVC driven. 2) It utilizes hooks and plugins to modify code areas to your site (which would not be rails compatible). You are better off going with a completely new rails project environment from scratch or if you must use vbulletin then go with a vbulletin based CMS like VBadvanced.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Ruby and RoR Setup Frustrations
Okay, I'm starting to get a headache (mostly because I refuse to give up) and continue to try to get ruby and ruby on rails configured. Let me explain my issues... I'm running Windows Vista with Ruby 1.9.1 and MySql 5.0.x It took me awhile to get this setup to work but I managed to do it. In order to get Ruby 1.9.1 to work I had to use a ming compiled version. In order to get mysql to work, I had to build the binary locally. The good news is I can create a new rails project, start it, and the "about your rails environment" shows the following: Ruby version 1.9.1 (i386-mingw32) RubyGems version 1.3.3 Rack version 1.0 bundled Rails version 2.3.2 Active Record version 2.3.2 Action Pack version 2.3.2 Active Resource version 2.3.2 Action Mailer version 2.3.2 Active Support version 2.3.2 Application root D:/ncaastatpages Environment development Database adapter mysql Database schema version 0 So, it sees mysql, everything is golden and throws no errors. That's the good part. Now the headache begins. Issue 1: Because of the way I had to compile mysql to work and using ruby -e to require it, there's no gem listed. If I require 'mysql' everything works just like a gem is installed. However if I do gem list it does not show up. While this is just a trivial issue (for me), it's a bigger issue with some IDEs like Aptana Studio which tried to install a different mysql gem and screw up my entire setup. Issue 2: Here are the gems I have currently (that work 100%): All Rails Gems (2.3.2) --action..etc.. capistrano (2.5.5) cgi_multipart_eof_fix (2.5.0) gem_plugin (0.2.3) highline (1.5.1) net-scp (1.0.2) net-sftp (2.0.2) net-ssh (2.0.11) net-ssh-gateway (1.0.1) rails (2.3.2) rake (0.8.7) rspec (1.2.6) rubygems-update (1.3.3) test-unit (2.0.2) Notice that mysql does not show up under the list but it's there because I used: ruby -e 'require "mysql"' With IDEs like Aptana Studio, they want to install mongrel, linefeed, etc. but they keep installing the wrong versions that require msvcrt-ruby18.dll instead of the msvcrt-ruby191.dll. So, my questions are in order: 1. What gems "must" I have working and operable to run a full rails development project? 2. Is there a way to tell Aptana Studio to not mess up my current rails installation by attempting to install gems that are outdated or the wrong kind? 3. Is there another IDE I should consider? (I tried Jedit but it felt clunky) - I previously used Scite which didn't give me any issues but again, it lacked a lot of features that I might need. 4. What am I missing here? My frustrations with Ruby and RoR isn't the programming! It's the installation! The programming, MVC concepts are wonderful! I've never experienced (working with any programming language) where the installation would be a 9 out of a 10 difficulty rating and the programming would be a 2 out of 10 difficulty rating for ease of use. I run a windows box and a virtual box with linux but I refuse to give up on the windows end. I want to be able to program with both systems. I'm not afraid to test the waters and go through hoops and hurdles to get them both working 100%. My issues are that the hoops seem to be surrounded by fire where windows is concerned. Any help would be appreciated. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Question on Hosting and Rails
Good idea - thanks mate -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Question on Hosting and Rails
My current host is gatorhost.com. They use Ruby 1.85 and rails 2.3.2 I use Ruby 1.9.1 and rails 2.3.2. Will I have a problem with any of my rails environment apps if I use them on my hosted domain? -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
I fixed all my issues and am up and running. Here's what I did to fix them all... First, I had to uninstall my old ruby and gems.. In my case I had to do sudo gem uninstall --install-dir "/path/to/directory" NameOfGem to uninstall all of mine because gem uninstall could not find them. I did that first by just doing a locate (name of gem) to see which directory it was in. I uninstalled all the gems and then I uninstalled Ruby using the following: sudo apt-get remove rubygems ruby irb ri rdoc ruby1.8-dev .. that solved the uninstall issues. Installing Ruby 1.9.1 and Rails I created a checklist of everything I did when installing ruby and rails from source in case someone else has the same issues I did. Here's the instructions. Prep Tools and Libraries 1. Download latest 1.9.1 source and place in Directory/src. 2. Go to terminal and type the following: 3. TYPE sudo apt-get install build-essential wget libreadline5-dev libncurses5-dev zlib1g-dev libsqlite3-dev libssl-dev Installing Ruby Source 1. Go to src directory on desktop via terminal. 2. Type ls to see name of package. 3. Type tar xvzf (name of package) 4. Type rm *.gz (to remove the .gz src file) 5. Type cd ruby(tab) to finish dir typing 6. Type autoconf (to check if autoconf is there) 7. Type sudo apt-get install autoconf (to install autoconf) 8. Type autoconf 9. Type ./configure --prefix=/usr --enable-pthread 10. Type make 11. Type sudo make install Check Versions 1. Type ruby -v (should be latest version) 2. Type gem -v (should be latest version) 3. Type sudo gem update (everything should be up to date) 4. Type irb (to access IRB) 5. Type RUBY_VERSION (should show latest version) Install Rails and other gems 1. Type sudo gem install rails sqlite3-ruby rubygems-update test-unit capistrano rspec 2. Type rails -v (to check rails version) 3. Type rails testapp 4. Type cd testapp 5. Type script/server 6. Open Browser 7. Type http://localhost:3000 Everything should be running fine. In my case I'm up and running. As a new user to linux I had to research several sites to find all the information. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Simon Macneall wrote: > try sudo gem install > Or, rather, same error as above (minus the writeable issues) -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Simon Macneall wrote: > try sudo gem install > Tried that already - same error... -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Hi everyone - thanks for all of the input. Here's an update: I did install VirtualBox on my Vista and got the latest ubuntu and created a virtual drive etc., installing it. I'm now up and running with Vista and Ubuntu I managed to figure out how to install ruby with a sudo command. But, having a lot of other issues. I'm not all that familiar with linux so here's the list of issues I'm experiencing: I'm currently using ruby1.8.7 (2008-08-11 patchlevel 72) [i486-linux] according to ruby -v. I managed to get rubygems by typing sudo apt-get install rubygems1.8 and that installed the gems system. I did gems install rails and got a strange error saying that I don't have /home/elricstorm/.gem/ruby/1.8/bin in your path... I went out on the web and figured out how to change path by doing.. PATH=$PATH:/home/elricstorm/.gem/ruby/1.8/bin export PATH I tried installing hpricot, mysql, a few others and keep getting the following error: WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and /var/lib/gems/1.8/bin aren't both writable... Building native extensions. This could take a while... Error: Error installing mysql: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install mysql extconf.rb:1:in `require`: no such file to load --mkmf (LoadError) from extconf.rb: 1 .. I get this for a few gems, similar... Any help with my newbish run at linux would be appreciated. Also, what should I be using for an editor to program with on linux.. On windows I just used Scite.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: I need a lot of advice here - let's start from the beginning
Jim wrote: > 1,2. I would highly recommend doing it on Linux. You can easily do > this while still using Windows by using virtual machine software such > as VirtualBox(virtualbox.org) or Vmware(vmware.com). Go with > Virtualbox. It's pretty good and easy to use and FREE. You won't > have to worry about rebooting or dual-booting. It will let you run > Linux under Windows. So, just install Ubuntu into it. I recommend > Ubuntu 8.04 desktop. Afterwards, just google how to install RoR onto > Ubuntu 8.04 and you'll get a couple of good pages with great step by > step instructions. It won't as hard as you think. > > 3. I found the Agile Web Dev with Rails book to be very good for > getting started over a year ago. It takes you through a simple > project and get your familiar with the basic stuff. Afterward it runs > through more detailed information you'll probably want to also use. > > 4. If your deployment environment is Linux, then go development in > Linux. It'll make your life easier when you encounter and solve > problems on linux during development instead of running into them when > you deploy. > > Good luck. Jim - thanks a ton. I will look into VirtualBox and see how it fares with Vista, before installing. Here are a list of the books I have (currently) (I have PDF formats (digital licenses) for the following: Agile Web Development with Rails (I'll read this one next) Beginning Ruby - From Novice to Professional (the one I've read so far) Practical Ruby Gems Enterprise Integration with Ruby Everyday Scripting with Ruby Learn to Program OReilly - Shortcut RJS Templates for Rails OReilly - Web Services on Rails Programming Ruby Rails Recipes That's my current list... What would you recommend for linux use (as far as a book to read about it) - I'll go with ubuntu.. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] I need a lot of advice here - let's start from the beginning
Hi Everyone, I'll try to make my opening summary as short as possible. I work as a hobbyist in web development (using Dreamweaver CS4, Photoshop CS4, PHP, Swishmax2(flash)). My dominant sites are all on "linux/unix" boxes but I program on a Windows Vista machine. I program for fun with C++, Autoit, Actionscript, and PHP for the most part. My background is that I've been in the IT industry for more than 16 years and I'm an extreme troubleshooter but I'm also a Windows System Administrator. That basically means I'm a jack of all trades where windows is concerned because I've seen a lot of things over the years as I dabble a lot. I have a photographic memory with a logical foundation set within. Therefore, I learn a lot faster than most people because I can retain information like a sponge to water. I have a lot of time available (in-between job searches right now) so I decided to spend my time wisely. About one week ago, I decided to push into Ruby with the idea that I'll eventually get into Ruby on Rails. I've researched it and it's the route I want to go. Anyhoo, I do not use linux and am not very familiar with linux. Some folks say it's not hard to use Ruby on windows and it's come a long way so I started pulling in some research materials. Here's what I've accomplished in one week so far: I read my first ruby book (Beginning Ruby - From Novice to Professional) by Peter Cooper. I installed Ruby using the one-click-installer I learned how to install and use gems. I learned the difficulty with installing gems that needed --platform=mswin32 I created my first program from scratch (an html parser I called scraper.rb) which pulls statistics off a website and stores it in yaml. I was instantly thrilled with the concept of classes, methods, even happy with how interpolation worked with variables. I thought to myself this is going to be great! I can design a class based app that can become modular as I build it and not suffer through past programming experiences. I was just about to get into RoR when I thought to myself it might be better to go with the latest ruby. So, I managed to upgrade my ruby to 1.9.1. I ordered another book from O'Reilly which is supposed to help with transitions from 1.8 - 1.9. I found out there were a lot of issues upgrading, namely with how a lot of the gems I used to be able to use no longer worked. The biggest issues I face now are using mysql on windows and also that my DBs online are 5.1. Keep in mind the online DBs are in fact on a linux/unix box and not on a windows but I do my programming on a windows box. Make sense? I hope so. It's just a convenience for me because I'm more fluent with windows. However, now I cannot get mysql to work. I did work through a lot of websearches and found the best install fix for me was something like: gem install kwatch-mysql-ruby --platform=mswin32 --source=http://gems.github.com/ However, when I tried to install it, I get the following error: *** ERROR: can't find mysql client library. *** extconf.rb failed *** I use mysql 5.1 on my windows machine and use Wampserver as my original development server/platform. So, I'm a little frustrated but I know I can get through this. And, I don't want to give up on Ruby at all. So, my questions are as follows: 1. What would you recommend I do concerning developing on a windows box when my websites are located on linux/unix. Is it doable? Do I have to make a lot of adjustments? 2. If I had to go to linux to use RoR effectively, how steep is the learning curve going to be and what would I need to do to ensure that I can dual-boot on both vista and linux where appropriate? 3. What other suggestions can you give me to help improve my transition to ruby on rails (things that you might have encountered and learned from) 4. Is it worth it to stick with RoR as a native windows user or should I be thinking about something else. I apologize for the very long post but I needed to start with a wide audience to retrieve the best answers. Many thanks to any who read and respond accordingly. J.D. -- 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@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---