Unable to Start with Rails.

Hi Everyone..

     I am pretty new to Rails. But i have to admit, getting started with Rails is one of hardest thing that i have ever come across! Not matter what i do, i face one issue after the other, and i have posted my issues on some other forums with little or no help. So i thought i would be detailed and precise in what i did and let you guys know step by step of what i did. So its gonna be a long one!

1. Downloaded the Ruby 1.9.3 exe file and installed it in C:\Ruby193. This is the only part which i can do without trouble!! :slight_smile:

2. I installed the latest rdoc gem, because in previous attempts it was causing a lot of problems.

3. Ran command "gem install rails". It did what it had to do and then gave this:

[code]ERROR: While generating documentation for activesupport-3.1.3 ... MESSAGE: error generating ActiveSupport/Inflector.html: incompatible encoding regexp match (UTF-8 regexp with IBM437 string) (Encoding::Compatib ilityError) ... RDOC args: --op C:/Ruby193/doc/activesupport-3.1.3/rdoc lib --title activesupport-3.1.3 Documentation --quiet[/code]

4. After some Googling found a solution and did chcp 1251 and the executed the command "gem install rails". This time it did install, the rails 3.1.3 gem properly.

5. Ran rails -v and it executed properly.

6. Created my own folder "railscode" for my rails codes.

7. Ran "rails new sample_app -T". I am learning from this website:

http://ruby.railstutorial.org/chapters/static-pages#top

Got an exception:

[code]Please update your PATH to include build tools or download the DevKit from 'Downloads’ and follow the instructions at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit’ An error occured while installing json (1.6.1), and Bundler cannot continue. Make sure that `gem install json -v '1.6.1'` succeeds before bundling.[/code]

8. After that I Googled and ran DevKit from GitHub. Did as told and created a new sample_app rails application. This time without the issues.

9. I went into sample_app folder, ran "rails s" and got this exception:

[code]C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- set (LoadError)         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/resolver.rb:1:in `<top (required)>'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:151:in `resolve'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `<top (required)>'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'         from C:/railscode/sample_app/config/boot.rb:6:in `<top (required)>'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from script/rails:5:in `<main>'[/code]

Now please someone tell me where i went wrong. I am trying this for the past 3 days and with little to zero help, i am at a loss! This is the my last attempt!

[snip]

Now please someone tell me where i went wrong. I am trying this for the past 3 days and with little to zero help, i am at a loss! This is the my last attempt!

Just a thought but you'd find it easier trying to do this with Ruby 1.8.7 rather than 1.9

1.8.7 will still run rails 3.1.3 & is less problematical than 1.9.* in my experience.

Cheers,

    Phil...

Most advise against using Windows for RoR (go for Max or Linux such as Ubuntu). If you have to use Windows then I understand that http://railsinstaller.org/ may be the easiest way to get up and running.

Colin

That is exactly what i didn't want to do... RailsIntaller makes it so much easier and the learning part just goes out. And shifting from Windows is not an option, as its an office PC. Its comes with only WinXP.

It would be best if Ruby guys could make the installers much better, as it stands now, new guys like me, would just succumb under the errors/exception and just give up! Like i am... almost had enough of this! :frowning:

But any solution to this? From the tutorial, I create the sample application. Edit the gem file as mentioned (except i leave the rails part). My Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.3'

gem 'sqlite3', '1.3.3'

group :development do   gem 'rspec-rails', '2.6.1' end

group :test do   gem 'rspec-rails', '2.6.1'   gem 'webrat', '0.7.1' end

Run the command "bundle install" after i have created a sample application. It installs some gems. And then when i run "rails generate rspec:install" I get a huge exception.

C:\myrails\sample_app>rails generate rspec:install C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- set (LoadError)         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/resolver.rb:1:in `<top (required)>'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:151:in `resolve'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/definition.rb:124:in `requested_specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/environment.rb:23:in `requested_specs'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup'         from C:/Ruby193/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `<top (required)>'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'         from C:/myrails/sample_app/config/boot.rb:6:in `<top (required)>'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'         from script/rails:5:in `<main>'

I mostly need help on this. I don't know what's going here since i am a newbie, so cant help myself. Please any advise? Thanks for the replies guys!

Then install VirtualBox and some Linux distro. Zero cost (other than a little time to download) and you'll save yourself a lot of headaches.

Generally, if I see a posting asking for help and it mentions Windows I ignore it, because I won't be able to recreate the problem.

OTOH, I'm on a Mac with Linux VMs available, so it's easy to test a problem scenario.

FWIW,

Oh boy... I think that is why i don't get any replies i guess on other forums!! :slight_smile:

But any help on this now would be great... as getting Linux done would take some time. Also may cause some problems to my net connections. As I access internet via a VPN. And that VPN software is not available for Linux!

Just tried... typing commands in GitBash did solve the problem, for now. Strange! Just keep this advise handy for future Windows users. :slight_smile:

It would be best if Ruby guys could make the installers much better, as it stands now, new guys like me, would just succumb under the errors/exception and just give up! Like i am... almost had enough of this! :frowning:

Why don't send the feedback to the right channel?

http://groups.google.com/group/railsinstaller http://groups.google.com/group/rubyinstaller

But any solution to this? From the tutorial, I create the sample application. Edit the gem file as mentioned (except i leave the rails part). My Gemfile:

[...]

Run the command "bundle install" after i have created a sample application. It installs some gems. And then when i run "rails generate rspec:install" I get a huge exception.

C:\myrails\sample_app>rails generate rspec:install C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- set (LoadError) from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

Set is part of Ruby itself, if I do "require 'set'" in a IRB prompt it works.

I mostly need help on this. I don't know what's going here since i am a newbie, so cant help myself. Please any advise? Thanks for the replies guys!

Due the constant "install virtualbox/linux/learn everything" answers, I do recommend you join RailsInstaller or RubyInstaller list and ask there.

The guys over do understand better platform constraints and friendlier about them.

I don't think those here are *unfriendly* to those using windows, just that most here have not got the experience to answer the questions, and in some cases (such as myself) started with windows and then moved to Linux and found that life became much easier. It is possible though that with the development of railsinstaller life on windows is now ok.

Colin

By "unfriendly" I mean that every single problem users have and ask question about it the answer is "install VirtualBox and Linux".

With those answers people assume that:

1) The have the control on their environment to do these type of installations (lot of user don't have administrative privileges) 2) Users do have Linux/bash/git/gcc/apt-get/portage/whatever previous experience

Problem is, most of the time these assumptions do not apply and increase the frustration of newcomers/newbies that want to try out this thing called "Rails"

So for those who can't comply with these two assumptions the message is "you're not cool enough for this".

Projects like RailsInstaller and RubyInstaller exist to help out better integration and transition from Windows to Linux environments, but that only will happen when users feel comfortable with the newer tool.

But I understand not everybody sees this like this.

I don't think those here are *unfriendly* to those using windows, just that most here have not got the experience to answer the questions, and in some cases (such as myself) started with windows and then moved to Linux and found that life became much easier. It is possible though that with the development of railsinstaller life on windows is now ok.

By "unfriendly" I mean that every single problem users have and ask question about it the answer is "install VirtualBox and Linux".

Not true for 'every single problem'. I think if you were to look at my first post on this thread it says that most advise against using Windows, but if you have to then use railsinstaller. For some reason the OP has declined to do that.

With those answers people assume that:

1) The have the control on their environment to do these type of installations (lot of user don't have administrative privileges)

If they do not have control then I advise the use of railsinstaller.

2) Users do have Linux/bash/git/gcc/apt-get/portage/whatever previous experience

No such assumption is made. Most IT professionals will jump at the chance of learning Linux. It is an excellent plus on the CV. Using Rails is an ideal excuse for doing this :slight_smile:

Problem is, most of the time these assumptions do not apply and increase the frustration of newcomers/newbies that want to try out this thing called "Rails"

So for those who can't comply with these two assumptions the message is "you're not cool enough for this".

Rubbish, at least on my part anyway.

Projects like RailsInstaller and RubyInstaller exist to help out better integration and transition from Windows to Linux environments, but that only will happen when users feel comfortable with the newer tool.

I am not sure the Railsinstaller developers would agree that it exists to help people move to Linux, but perhaps you are right.

Colin

Not true for 'every single problem'. I think if you were to look at my first post on this thread it says that most advise against using Windows, but if you have to then use railsinstaller. For some reason the OP has declined to do that.

I was doing a generalization, a high percentage of that is what I see over stackoverflow, here and other forums.

I was not accusing you and apologies if that was the tone.

> 2) Users do have Linux/bash/git/gcc/apt-get/portage/whatever previous > experience

No such assumption is made. Most IT professionals will jump at the chance of learning Linux. It is an excellent plus on the CV. Using Rails is an ideal excuse for doing this :slight_smile:

On some business they see a lost of time by doing that, why try something new (which has a huge learning curve) when you are more billable using the existing tools, even if they make you cry.

(believe me, I've heard this argument)

Anyhow, for someone that wants to checkout Rails for the first time, the learning curve going that path is too huge for the time they wish to spend on this experiment. Sometimes people uses Rails as a good excuse to try out new prototypes and "sell" it to their bosses.

> Problem is, most of the time these assumptions do not apply and > increase the frustration of newcomers/newbies that want to try out > this thing called "Rails"

> So for those who can't comply with these two assumptions the message > is "you're not cool enough for this".

Rubbish, at least on my part anyway.

Apologies again for making it sound was you, I was generalizing from what normally happens on many forums.

Yet still, rubbish or not, it happens.

> Projects like RailsInstaller and RubyInstaller exist to help out > better integration and transition from Windows to Linux environments, > but that only will happen when users feel comfortable with the newer > tool.

I am not sure the Railsinstaller developers would agree that it exists to help people move to Linux, but perhaps you are right.

Dr Nic is the idea generator of RailsInstaller, Wayne E. Seguin was the developer and I assisted him on ensure best usage of RubyInstaller and DevKit.

Now, related to what is the goal of RailsInstaller, you can read it here:

Anyhow, as RubyInstaller developer is not our goal to alienate Windows developers/user and force them to migrate to Linux, but instead give them a choice.

RubyInstaller project is working on providing a better and solid Ruby for Windows and RailsInstaller, by using it, will improve too.

But, for that to happen, a supportive and friendlier community is required.

RubyInstaller project is working on providing a better and solid Ruby for Windows and RailsInstaller, by using it, will improve too.

That is an excellent aim.

But, for that to happen, a supportive and friendlier community is required.

I will continue to point those who have to use Windows towards that project, hopefully in a friendly manor :slight_smile:

Do you believe that it is still true that for those that /can/ use Linux or Mac for Rails development they are better off doing that?

Colin

Not true for 'every single problem'. I think if you were to look at my first post on this thread it says that most advise against using Windows, but if you have to then use railsinstaller. For some reason the OP has declined to do that.

I was doing a generalization, a high percentage of that is what I see over stackoverflow, here and other forums.

If the high proportion of what you see is people saying the same thing... do you think that *maybe* they have a point...?

1) The have the control on their environment to do these type of installations (lot of user don't have administrative privileges)

This is ridiculous - if they have no enough control on their environments to install Ruby, RubyGems, MySQL (if used), or RailsInstaller, and any other tools they want to do Rails development, how do they not have rights to install VirtualBox and a *nix VM?!

> So for those who can't comply with these two assumptions the message > is "you're not cool enough for this".

Rubbish, at least on my part anyway.

Yet still, rubbish or not, it happens.

No - it's rubbish full stop. Please send links to posts that imply people are "not cool enough for this".

At the current state of Ruby, yes.

If they have the access to the platforms and the willingness/time associated with learning the differences, getting started on those platforms might be a better option for them.

>> Not true for 'every single problem'. I think if you were to look at >> my first post on this thread it says that most advise against using >> Windows, but if you have to then use railsinstaller. For some reason >> the OP has declined to do that.

> I was doing a generalization, a high percentage of that is what I see > over stackoverflow, here and other forums.

If the high proportion of what you see is people saying the same thing... do you think that *maybe* they have a point...?

Most of the times the developers giving those answers haven't touch Windows in the past 10 years, nor they know anything about RubyInstaller, RailsInstaller or other projects that work to improve the development ecosystem for Ruby.

It is funny that Ruby (mostly Rails) is only community I know that attacks developers using Windows while others like PHP or Python just accept them and try to point them to the right places.

> 1) The have the control on their environment to do these type of > installations (lot of user don't have administrative privileges)

This is ridiculous - if they have no enough control on their environments to install Ruby, RubyGems, MySQL (if used), or RailsInstaller, and any other tools they want to do Rails development, how do they not have rights to install VirtualBox and a *nix VM?!

You can download binary packages of mysql and extract in your home directory, without installation.

If you want to use SQLite3 instead, you can do it.

Also goes to ImageMagick, Sphinx, GCC (RubyInstaller devkit)

Oh, and I forgot to mention that RubyInstaller and RailsInstaller requires no administrative privileges to be installed, so normal users can install it inside their own user folder.

Or better yet, download the binary package of RubyInstaller, extract and use.

So, you're ignoring that things work differently, period.

Whoa, hold on there buckaroo!

We do *not* "attack" them! (Okay, maybe *some* people do, but the Ruby community at large certainly doesn't, and frowns on those who do.) We just tell them that they're probably going to have some additional difficulties. If they want to keep developing Ruby under Windows, for whatever reason, they're welcome to, and we'll gladly give them what help we can. However, a lot of it is based on the values of environment variables (especially paths) and other things that are a good bit harder to deal with properly under Windows than on Unixes (including Linux and, under the hood, Mac).

If it were a matter of snobbery, you'd probably see the Linux and Mac guys "attacking" each other. But no, it's a simple realization that some tools are better than others at certain things. Yes, one could argue that one of the above is better than the other for such tasks... but the difference is small enough that it's not a significant added difficulty, especially as compared to Windows.

Analogy: if you want to carve your turkey with an ordinary table knife, because that's all you've got and after all that's what most people use for most of their general food-prep-with-a-knife purposes, you go right ahead. It will still work OK (albeit with a lot more effort), and we of the turkey-carving community will still give you turkey-carving advice if you ask. However, we'll still recommend you use a proper carving knife, or maybe a butcher's knife, or at least a large high-quality steak knife. On the other claw, we also wouldn't recommend using a carving knife for spreading butter on our dinner rolls.

-Dave

Luis, Linux/Unix is neither new nor an experiment. Linux is 20 years old. The Unix and Unix like operating systems are new like America was new when Columbus crossed the Atlantic. I know he missed America but that's not the point. America had been there for centuries. It was just new to old Christopher and the people in Europe. In many ways people who have been developing in Windows land see Linux as a new land and have a tough time with the learning curve in this new world. Anyway, Somnath, if you're stuck in Windows land a JVM based language might be the way to go. JRuby which is a JVM based language is much less problematic on Windows than native Ruby. It runs as good or better on the JVM compared to native Ruby (even on Linux) and from what I have read is very ROR friendly. Some limitations but they are fewer and fewer as time goes on and this might help you get around the problems you are having with Ruby on Windows. I tried Ruby/Rails Installer on the XP laptop I have at work and bagged it after about a 1/2 hour and just stayed with Ruby on Ubuntu. Wasn't worth the aggravation for me.

Rick

If the high proportion of what you see is people saying the same thing... do you think that *maybe* they have a point...?

Most of the times the developers giving those answers haven't touch Windows in the past 10 years, nor they know anything about RubyInstaller, RailsInstaller or other projects that work to improve the development ecosystem for Ruby.

That's another *big* sweeping statement on your part :-/

Personally, I think that given the shear weight of numbers, I doubt that "most" of those developers aren't likely to have "touched Windows in the past 10 years" (for instance, I spent the first six months of this year developing a Rails app on Windows for a client - I wouldn't, and I don't, recommend it, though sometimes needs must).

It is funny that Ruby (mostly Rails) is only community I know that attacks developers using Windows while others like PHP or Python just accept them and try to point them to the right places.

Again... cite some of your sources for these assertions, as your opinion is rapidly going downhill in my estimation when you say stuff like this.

You can download binary packages of mysql and extract in your home directory, without installation.

<snip other examples of non-admin installing>

Yes, and with those exact same rights, you can install a portable copy of VirtualBox.

So, you're ignoring that things work differently, period.

I'm ignoring nothing of the sort. I've never said (or ever recall anyone else saying - though I'm willing to admin that I might have missed a thread...please point me at it in the archives...) that these things aren't possible. I *agree* with you that there are several opportunities for people to develop on Windows. And if those tools are increasing, so much the better. But when a person presents on this list with some obscure OS-related problem, and does happen to be working on a locked-down Windows machine, there is little to say but "you really wouldn't have this problem if you were developing in *nix" and "sorry, I don't use Windows, because when I did, I had problems like these".

If they happen to be using RailsInstaller, and there is a Google group for it, it seems to me the most simple solution to say "go ask over there". No malice, or spite intended, it's just that that their problem generally *isn't* with Rails, it's with Windows...

That's another *big* sweeping statement on your part :-/

Personally, I think that given the shear weight of numbers, I doubt that "most" of those developers aren't likely to have "touched Windows in the past 10 years" (for instance, I spent the first six months of this year developing a Rails app on Windows for a client - I wouldn't, and I don't, recommend it, though sometimes needs must).

> It is funny that Ruby (mostly Rails) is only community I know that > attacks developers using Windows while others like PHP or Python just > accept them and try to point them to the right places.

Again... cite some of your sources for these assertions, as your opinion is rapidly going downhill in my estimation when you say stuff like this.

It will take me long time to find all the sources for those assertions starting from 2006 until now.

Sorry for you think that my opinion is going downhill because of that, I thought that perhaps my experience and what I do will be enough:

* Creator of RubyInstaller, the replacement of One-Click Installer for Windows * Creator of rake-compiler and similar tools to ease cross platform work, not just Windows. Used by more than 50 developers on their gems * Assisted gem developers to better integrate cross-platform tools in their workflow and ease their own native or cross platform compilations (not just Windows) * Ruby-Core committer, maintainer of MinGW platform support. * Maintainer of sqlite3-ruby, mysql and other gems that were left orphaned in the world. Help improve it's cross-platform support * Assisted on the creation of RailsInstaller * Active participation on most Ruby and Windows forums and from time to time on Rails ones attempting to assist users with difficulties.

Sorry if I made you think that my comments were built without bases, I've been here doing this for quite some time and this is the picture that some parts of the community expose.

Again, is not *everybody* that acts this way, there are a few.

> You can download binary packages of mysql and extract in your home > directory, without installation.

<snip other examples of non-admin installing>

Yes, and with those exact same rights, you can install a portable copy of VirtualBox.

You still need elevation of privileges to install networking, which defeats the purpose of portable.

> So, you're ignoring that things work differently, period.

I'm ignoring nothing of the sort. I've never said (or ever recall anyone else saying - though I'm willing to admin that I might have missed a thread...please point me at it in the archives...) that these things aren't possible. I *agree* with you that there are several opportunities for people to develop on Windows. And if those tools are increasing, so much the better. But when a person presents on this list with some obscure OS-related problem, and does happen to be working on a locked-down Windows machine, there is little to say but "you really wouldn't have this problem if you were developing in *nix" and "sorry, I don't use Windows, because when I did, I had problems like these".

I agree, sometimes users reports problems in obscure ways that is hard to help, that happens to me too.

What I feel bad about is that on those occurrences the answer is "install linux" a high percentage of the time. Again, this statement is coming from posts on Stackoverflow, ruby-talk and here, search for Rails Windows Install Linux and will see.

Yet still, users that are linux ones still have issues dealing with Ruby, Rails and sometimes the contradictory indications they receive -- use apt-get to install Ruby versus install RVM or the missing pieces of Ruby they get when using apt.

Again, please apologize if what I said did affect you personally, I'm not a native english speaker so sometimes the way things are expressed in my language do not translate properly to english.