Forum: Ruby on Rails I need a lot of advice here - let's start from the beginning

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-28 22:48
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.
0373b303fabbee5e4f09059ad045e074?d=identicon&s=25 Jim (Guest)
on 2009-05-29 01:49
(Received via mailing list)
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.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 02:34
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..
0373b303fabbee5e4f09059ad045e074?d=identicon&s=25 Jim (Guest)
on 2009-05-29 03:14
(Received via mailing list)
I use Vista Business edition.  You shouldn't have any problems with
VirtualBox.  I use Vmware player, but it's a bit harder to setup
initially so I can't recommend that for now.  Just download the Ubuntu
iso file from ubuntu.com and use that as a cd image in virtualbox.
The instructions for installing Ubuntu as straight forward.  I
recommend 8GB disk space on virtualbox for this.

Here's a great link for installing RoR on Ubuntu 8.04.
http://www.rubyhead.com/2008/04/25/installing-ruby...

I don't know what your background in programming is, but Programming
Ruby would be good to read after ~100pages of the Rails book.  If you
need more background in programming, maybe the Learn to Program book
might be useful.  You'll only need basic linux commands for most of
what you'll do.  Quick google searches will help you.  I haven't read
any linux books, so I can't suggest anything.  I think you'll be
surprised at how easy Ubuntu will be to use.

I recommend using Netbeans as a development environment after you do
your first couple of projects.  Do the first projects following the
book as it will give you a good foundation for understanding how
things work.
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2009-05-29 03:19
(Received via mailing list)
We are using VMWare on Vista, and having no problems. I have had a bit
of
a look at VirtualBox, but the tools for vmware seem a bit more complete.
On the 'harder to set up' issue, there are appliances that you can
download that are pretty much a complete ubuntu vm. Just download and
away
you go.

Cheers
Simon
0373b303fabbee5e4f09059ad045e074?d=identicon&s=25 Jim (Guest)
on 2009-05-29 03:37
(Received via mailing list)
Yup, you are correct.  It's possible to download a VMware appliance
that has Ubuntu.  I actually haven't tried any premade appliances
yet.

I used to use VMware server until they changed it so I couldn't really
use it as standalone.  I'm using VMware player now but using my own
empty template so I can set up any OS I want.
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2009-05-29 03:41
(Received via mailing list)
The other thing to consider (I had a quick look at VirtualBox the other
day) is that the VMWare vms are portable across OSs, while VirtualBox's
aren't

So, if you are using vmware, your dev vm on vista will run on vmware
player on Linux, but this doesn't apply for VirtualBox. However, they
have
some sound reasons for this, including making the vm files smaller.
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2009-05-29 05:05
Jim wrote:
[...]
> I recommend using Netbeans as a development environment after you do
> your first couple of projects.

I'm going to disagree rather strongly here.  Rails doesn't seem to lend
itself all that well to "heavy" IDEs like Eclipse (which I used to use,
and would probably still use for Java) and NetBeans (haven't used, but
seems like the same niche).  I've had much better luck with simpler
tools like jEdit (see http://marnen.livejournal.com for setup info) and
KomodoEdit (my current choice), or even plain editors like TextWrangler.

(BTW, Eclipse and NetBeans *still* don't do word wrap reliably.  WTF?)

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2009-05-29 05:10
(Received via mailing list)
Heh?

you are disagreeing rather strongly based on a program that you have
never
used?

We use netbeans as our Rails dev environment, and have had no problems
at
all.

On Fri, 29 May 2009 11:05:46 +0800, Marnen Laibow-Koser
Dd2d775dea75b381edb1bbf0600a0907?d=identicon&s=25 Marnen Laibow-Koser (marnen)
on 2009-05-29 05:20
Simon Macneall wrote:
> Heh?
>
> you are disagreeing rather strongly based on a program that you have
> never
> used?

I should have been clearer.  Based on the research I've done about
NetBeans, and on how the program is marketed, it seems that its
Eclipse-like nature and what I understand to be a heavy JRuby
implementation are not really the way I want to go about Rails
development.  I might still try it, but I believe (if the info I have is
accurate) that it is the wrong direction to go for Rails, at least for
the way I like to work.

>
> We use netbeans as our Rails dev environment, and have had no problems
> at
> all.

I wasn't exactly talking about problems.  I never really had any
*problems* as such with Rails and Eclipse.  It just got to feel like
trying to run wearing ski boots after a while, and I didn't like that.

I'll turn around the question: why NetBeans?  What makes such an
apparently heavy IDE worthwhile for Rails?  I'd be very interested to
know.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2009-05-29 05:37
(Received via mailing list)
On Fri, 29 May 2009 11:20:23 +0800, Marnen Laibow-Koser
<rails-mailing-list@andreas-s.net> wrote:

>
> I should have been clearer.  Based on the research I've done about
> NetBeans, and on how the program is marketed, it seems that its
> Eclipse-like nature and what I understand to be a heavy JRuby
> implementation are not really the way I want to go about Rails
> development.  I might still try it, but I believe (if the info I have is
> accurate) that it is the wrong direction to go for Rails, at least for
> the way I like to work.
>
not sure what you mean by a heavy JRuby implementation. You can select
which ruby to use. Out of the box it installs JRuby, but you can switch
this to normal ruby easy enough.

>>
> I wasn't exactly talking about problems.  I never really had any
> *problems* as such with Rails and Eclipse.  It just got to feel like
> trying to run wearing ski boots after a while, and I didn't like that.
>
I had that feeling trying to use Eclipse for both C++ and Java. I think
it
is an offshoot of the fact it is written in Java, whereas (and I might
be
corrected here) Netbeans is written in C++.

> I'll turn around the question: why NetBeans?  What makes such an
> apparently heavy IDE worthwhile for Rails?  I'd be very interested to
> know.
>
We were already using Netbeans for our Java dev, so it was natural to
try
it for Rails. The debugging is pretty good, and the project management
side seems better than Eclipse (that said, I haven't tried eclipse for
several years now). I guess mostly, once you are using it, there isn't
anything that is annoying me enough to want to try something else.

Cheers
Simon
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 05:59
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..
41cc2c53544016a86472343ab3fdc0ff?d=identicon&s=25 Simon Macneall (Guest)
on 2009-05-29 06:01
(Received via mailing list)
try sudo gem install

On Fri, 29 May 2009 11:59:03 +0800, J. D.
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 06:10
Simon Macneall wrote:
> try sudo gem install
>

Tried that already - same error...
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 06:12
Simon Macneall wrote:
> try sudo gem install
>
Or, rather, same error as above (minus the writeable issues)
B6a2e2c1454c56eb686c5a38b5f73d02?d=identicon&s=25 Joel Dezenzio (elricstorm)
on 2009-05-29 17:06
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.
Fac81a9d95c81d817a2debb6f717f3ac?d=identicon&s=25 Sazima (Guest)
on 2009-05-29 18:29
(Received via mailing list)
Try REE and Passenger:

http://phusion.nl/

Cheers, Sazima
2070642e52c40b13a0250468fb4df0d6?d=identicon&s=25 Ricardo Sanchez (Guest)
on 2009-05-30 09:17
(Received via mailing list)
For IDE, I would suggesst Aptana's RadRails (http://www.aptana.com/
rails).
It is based on Eclipse and designed well to implement/deploy RoR
applications
(it has a nice feature called AptanaCloud which lets you deploy RoR
applications
in the cloud in minutes). One thing to remember, building RoR
applications is just
one part of the equation, with the other being deployment. There are
several solutions
around for this (mongrels+rails, apache+phusion-passenger+rails, etc.)
and they all
require certain level of Linux expertise. That is what makes an IDE
like RadRails sweet:
it will take care of the deployment part for you so you can focus on
building the application
and not have to configure a Linux Box with server capabilities.

Regards,

- Ricardo Sanchez
rsanchez.jayhawk@gmail.com

On May 28, 10:05 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-
This topic is locked and can not be replied to.