Problem to run Sphinx on Ruby on Rails 2.3.2 - ruby-on-rails

Yesterday I was trying to install Sphinx for full-text search on Windows 7. So, I followed their website's installation steps.
Once I installed its windows service, I ran the indexer and then the test search against my app database and it worked great.
Then, I wanted to make it work on Ruby on Rails 2.3.2, so I downloaded and installed the thinking-sphinx plugin. I followed these steps, creating the sphinx.conf file at the config directory of my app, and then I ran the rake thinking-sphinx:indexer and it worked great. After that, when I wanted to start it, as it's explained in that guide, it didn't start...it just keep saying "thinking-sphinx:start", and it didn't either stop or start.
What am I doing wrong?
Thanks,
Brian

Well, it seems that without starting it using rake it works anyway...it's maybe because the Sphinx service is already started, so you don't need to start it also with the rake from ruby.
I've got another doubt now...I'm from Argentina and we use accents to write in some words...for example "acción", which means "action" in english. I tried searching that word without the accent(people don't ussually write accents on searches) and it didn't bring any results, but if I search it with the accent, it will bring results.
How can I fix that?
Thanks,
Brian

Related

Error message when starting Ruby on Rails server

hope I can get some help with a problem I have been having. I am getting into Ruby on Rails and used a tutorial (http://guides.rubyonrails.org/getting_started.html) to try to get started with it. It says I need Sqlite3. I followed the steps up to the point where it says to use the ruby bin\rails server command in command prompt. However, when I try to do this, I get the following error message.
When I try to install Sqlite3, I use the x86 version for Windows, as I am using Windows 8.1.
I don't know what I am doing wrong...I am not even sure if the SQlite3 files are in the right place. I use command prompt to check if I have Ruby, Rails, and Sqlite3 all installed, which I do. I also know I have the SQlite3 Ruby gem installed. I have also added SQlite3 to my PATH system variable, but that doesn't seem to work either. I always get the same above error message no matter what I do.
Anyone have any ideas as to what the problem might be? Any help would be greatly appreciated! Thanks!
I recommend setting up a Linux VM on your Windows PC and start coding on it instead of on Windows. You'll keep encountering many issues in the future if you stick with Windows. Windows & ruby on rails don't go well together. So, it's better to go with some Linux flavor or preferably Mac.
If you are going to be learning RoR with the goal of ever doing anything serious in the future, here's the best advice I can give to someone starting out: Buy a Mac. NEVER try to use Microsoft for anything but Microsoft office... you'll just end up so frustrated that you will give up. RoR is NOT the toy to try "round peg, square hole" with.
Next, being that your on a Mac, NEVER use sqlite3. You can easily use the correct database which is PostgreSQL. Why is this important?
You're starting out. Keep things very simple. Get a free Heroku account, and install the CLI (for mac). You can then do: "heroku local" to run your code locally (for building), and because it's Mac/PostgreSQL, when you go to push that code live, everything is the same (Heroku is going to be PostgreSQL) so you won't get lost for days trouble shooting the differences between where you're building the code, and where you're running the code.

The system cannot find the path specified for rails

Hey guys so I am new to everything including computers I don't know squat, nothing! I am recently trying to take ruby on rails on lynda.com. I have ran into many problems with using ruby and downloading rails I have followed allot of helpful tips which have helped but I cannot seem to get out of this loop for 6 hrs already.
I am using ruby 2.2.4 ,rails 2.4.5.1 on the other hand I don't know how to use it and when I check
rails -v
this pops up
the system cannot find the path specified
I am using windows 10 by the way. So can someone please help in detail and hoping you have the patience to work with someone who knows nothing. Thanks in advance.
I assume that you need to install ruby and rails on your windows 10 machine.
You can use rails installer for installing ruby and all other stuff related to ruby and rails using a single installation.

Rails Sunspot Solr data source

Thank you in advance for bearing with me. I am new to Solr and looking to integrate into Rails. Although Postgres can text search, Solr seems to be faster..
I understand the modifications that need to happen to the models and controllers within the Rails app itself, however, I cannot seem to grasp when the xml files themselves will be defined and/or stored. Is there a configuration which points to a data source/xml file within Rails that I am missing? I understand that Solr runs and is launched right from the Sunspot gem, but how does that data source (in my case, xml files) communicate with the app? I am not sure if I understand how localhost:8983/solr is to interact with Rails as is would normally.
Any and all help is appreciated, many many thanks. I am running lion 10.7, ruby 1.9.7, rails 3.2.9, the sunspot gem... THANK YOU!
Not sure if I'm answering all of your questions, but when you run the command:
rails generate sunspot_rails:install
it generates a file in the config directory called sunspot.yml. In that file, it specifies how to connect with a running SOLR database depending on your environment.
The Sunspot gem then looks at that file in order to know how to connect to SOLR.

Install and start programming Ruby on Rails on Mac?

I would like to try ruby on rails on mac. I want to install ruby on rails, tried to find some guide for installation, and I get this:
ruby on rails official website??
It does not have a clear, I mean, well documentation for beginner to follow the steps? Or, thats all for the installation? How to start the webserver, where to store ruby files etc, ... how do I get started???
Any advise, or links or tutorials for a total ruby beginner to get started?
This is their official guide:
http://guides.rubyonrails.org/getting_started.html
You need to install xcode first though to avoid some errors. This is because some of the headers in the default ruby install on macs is incomplete without it.
Well you need GCC, which used to be with XCode only but over at ye olde GitHub, it's been packaged as a standalone. Next up you can follow either this tutorial by Katz or Dan Benjamin's guide on HiveLogic.
Keep in mind the state of the art in Ruby and Rails is fast moving so the guides might not take you all the way there. The most crucial parts are getting RVM installed properly and working and getting everything on the right version. It's not too tricky to work through, and there's probably no undocumented issues in the process now.

Rails Deployment on Win32 Best Practices: Lighty + Sgci

I've received some really great guidance from users of this site, and I'm thinking some advanced Rails people could assist me in resolving the following problem.
I'm attempting to deploy a simple Rails application on a win32 server.
I've been carefully working through these instructions (see http://functionalelegant.blogspot.com/2008/05/deploying-rails-on-windows.html) for win32 Rails application deployment.
I started from a more-or-less clean windows install, then downloaded and installed
Ruby
LightTPD
Rails
Zed's SCGI Rails Runner
Windows Server 2003 Resource Kit Tools
Ruby/DBI ADO package
After that, I've done the following:
I've commented out the line in the SCGI gem (which actually was causing trouble.)
I created the directory structure as suggested, with folders for logs.
I modified the scgi.yaml file and the Lighty config files to reflect my environmental settings.
After this, I wrote the batch scripts to start up Lighty and the SGCI process. They appear to run correctly. However, inside app-errors.log the following lines appear:
2009-05-15 16:48:06: (mod_scgi.c.2645) fcgi: got a FDEVENT_ERR. Don't know why.
2009-05-15 16:48:06: (mod_scgi.c.2469) emergency exit: scgi: connection-fd: 7 fcgi-fd: 8
Finally, when I navigate to http://localhost:xxxx/ I just see a blank page. Update: I just realized the blank page only appeared to be. Viewing the source revealed the following issue:
2C:/Ruby/lib/ruby/1.8/drb/drb.rb:573:in `load'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:612:in `recv_request'":C:/Ruby/lib/ruby/1.8/drb/drb.rb:911:in `recv_request'"?C:/Ruby/lib/ruby/1.8/drb/drb.rb:1530:in `init_with_client'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1542:in `setup_message'"6C:/Ruby/lib/ruby/1.8/drb/drb.rb:1494:in `perform'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1589:in `main_loop'"3C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `loop'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1585:in `main_loop'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `start'"8C:/Ruby/lib/ruby/1.8/drb/drb.rb:1581:in `main_loop'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1430:in `run'"4C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `start'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1427:in `run'"9C:/Ruby/lib/ruby/1.8/drb/drb.rb:1347:in `initialize'"2C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `new'"<C:/Ruby/lib/ruby/1.8/drb/drb.rb:1627:in `start_service'"MC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/lib/scgi.rb:402:in `run'"HC:/Ruby/lib/ruby/gems/1.8/gems/scgi_rails-0.4.3/bin/scgi_service:61"*C:/Ruby/bin/scgi_service:19:in `load'" C:/Ruby/bin/scgi_service:19: mesg" too large packet
Note that 'ruby script/server' runs just fine, but the page then can't be seen externally.
Any ideas? Please let me know if anything jumps out at you.
I wrote the chapter for this in 'Deploying Rails Applications'. http://www.pragprog.com/titles/fr_deploy/deploying-rails-applications
Basically, you want mongrel, mongrel_service, and apache 2.2 with mod_proxy_balancer for windows.
You install 2 or more instances of your app with Mongrel running on separate ports. You set the services to autostart.
Then you set up apache to balance to them.
This is all outlined in the book, and I have some older articles on my website too - if you search for "deloying rails on windows" you'll find some pretty out of date stuff. The apache+mongrel way is the best way for Windows right now, and if you need additional help, feel free to let me know. I'd be glad to help.

Resources