"Rails Installation on windows"

Problem : JSON not installable on WINDOWS , when we do bundle install

Solution :

Assuming you have Ruby and Ruby gems installed
 
> my current platform: ruby-1.8.6. From the command prompt, type:
gem install pik
> After the successful installation of pik, type:
pik_install C:tools
> Add this to your Path Environmental variables (My Computer > Right Click > Properties > Advanced System Settings > Environmental Variables > Path)

Once you’re done. Open a new command prompt and type:
pik list
It will add the current version of ruby into the list.
Now what’s so special about pik? How it can handle the multiple versions? To see that in action, in command prompt, type:
pik install ruby 1.8.7
pik install ruby 1.9.2
Similarly you can do for 1.9.2

pik list
It will show you the current version of ruby and the other ones.

pik use 187
or
pik use 192

depending on which version to use

ruby -v
now you can have multiple ruby versions on windows also

Time to install Ruby Devkit

Download  – http://rubyinstaller.org/downloads/

Install under C:/devkit

After extraction, open your command, go inside C:devkit prompt and type:
ruby dk.rb init
This will create the config.yml inside C:/devkit. Now you need to define all the Ruby versions inside that file, so that devkit will create native extensions for them. To do that, open that file and at the end of it, write these lines:
– C:ruby
– C:UsersPC-name.pikrubiesRuby-187-p330
– C:UsersPC-name.pikrubiesRuby-192-p0
Once done save it and from the command prompt, type:
ruby dk.rb install

Now you can do
your bundle install
or rails install

and it should work properly

Advertisements
"Rails Installation on windows"

"Rails Installer: Ruby and Rails on Windows in a Single, Easy Install"

RailsInstaller is a new project from Wayne E Seguin (of RVM fame) that brings RubyInstaller-style simplicity to getting Ruby and Rails set up on Microsoft Windows (XP, Vista, or 7). In a single wizard-driven installation you get Ruby 1.8.7-p330 (with DevKit), Rails 3.0.3, Git, and SQLite 3.

Rails Installer was developed with help from Luis Lavena (a Ruby on Windows expert) and Dr. Nic Williams (Engine Yard’s resident Australian comedian) and its release comes just weeks after Wayne was (re)hired by Engine Yard to work on new open source initiatives.

To get started, go to railsinstaller.org, download the “Rails Welcome Kit” and run the installer. There’s a screencast you can watch too. The process is as simple as it sounds and you can have a basic, empty Rails project running within minutes.

If you want to follow along more, check out the @RailsInstaller Twitter account or theRails Installer Google Group / mailing list.

"Rails Installer: Ruby and Rails on Windows in a Single, Easy Install"

"Ruby, Ruby on Rails Support Discontinued in NetBeans IDE"

Dear NetBeans Community: 

After thorough consideration, we have taken the difficult step to discontinue support for Ruby and Ruby on Rails in the NetBeans IDE. Two main issues underpin this decision: 

Java SE 7 and Java Development Kit 7 (JDK 7) are the next major releases of the Java SE platform, which Oracle is committed to deliver in 2011. A key objective of the NetBeans IDE has always been to offer superior support for the Java platform. To maintain that objective and capitalize on the JDK 7 release themes–multi-language support, developer productivity and performance–it is necessary that our engineering resources are committed to a timely and quality release of NetBeans IDE 7.0. 

Second: Although our Ruby support has historically been well received, based on existing low usage trends we are unable to justify the continued allocation of resources to support the feature. 

As of January 27, the Ruby module will be gone from development builds of NetBeans IDE 7.0. Developers who want to continue to use Ruby and Ruby on Rails functionalities in the NetBeans IDE should please visit the NetBeans Ruby Support page for details on how to do so going forward. 

We remain committed to delivering a first-class product to our community of developers and users, and we encourage your feedback on our mailing lists and forums, on Twitter, or by writing to us. 

Thank you for your continued support of NetBeans.
The NetBeans Team

Source : http://netbeans.org/community/news/show/1507.html


"Ruby, Ruby on Rails Support Discontinued in NetBeans IDE"

"csrf token warning fix"

csrf token warning fix

Solution:
1/ add this to your layout

<%= javascript_tag “var AUTH_TOKEN = #{form_authenticity_token.inspect};” if protect_against_forgery? %>
    <%= csrf_meta_tags %>

Add this to your controller
skip_before_filter :verify_authenticity_token

2/ comment out  protect_from_forgery from your application controller .

"csrf token warning fix"

"“Inheritance” and “Mixin Modules”"

Some object-oriented languages (notably C++) support multiple inheritance, where a class can have more than one immediate parent, inheriting functionality from each. Although powerful, this technique can be dangerous, as the inheritance hierarchy can become ambiguous.

Other languages, such as Java, support single inheritance. Here, a class can have only one immediate parent. Although cleaner (and easier to implement), single inheritance also has drawbacks—in the real world things often inherit attributes from multiple sources (a ball is both a bouncing thing and aspherical thing, for example). Ruby offers an interesting and powerful compromise, giving you the simplicity of single inheritance and the power of multiple inheritance. A Ruby class can have only one direct parent, and so Ruby is a single-inheritance language. However, Ruby classes can include the functionality of any number of mixins (a mixin is like a partial class definition). This provides a controlled multiple-inheritance-like capability with none of the drawbacks.

When a class includes a module, that module’s instance methods become available as instance methods of the class. It’s almost as if the module becomes a superclass of the class that uses it. Not surprisingly, that’s about how it works. When you include a module, Ruby creates an anonymous proxy class that references that module, and inserts that proxy as the direct superclass of the class that did the including. The proxy class contains references to the instance variables and methods of the module. This is important: the same module may be included in many different classes, and will appear in many different inheritance chains. However, thanks to the proxy class, there is still only one underlying module: change a method definition in that module, and it will change in all classes that include that module, both past and future.

<table class=codebox border=0 cellspacing=0 cellpadding=3 width=500><tbody><tr><td colspan=3 valign=top>module SillyModule</td>
</tr><tr><td colspan=3 valign=top>  def hello</td>
</tr><tr><td colspan=3 valign=top>    "Hello."</td>
</tr><tr><td colspan=3 valign=top>  end</td>
</tr><tr><td colspan=3 valign=top>end</td>
</tr><tr><td colspan=3 valign=top>class SillyClass</td>
</tr><tr><td colspan=3 valign=top>  include SillyModule</td>
</tr><tr><td colspan=3 valign=top>end</td>
</tr><tr><td colspan=3 valign=top>s = SillyClass.new</td>
</tr><tr><td valign=top>s.hello</td>
<td valign=top>»</td>
<td valign=top>"Hello."</td>
</tr></tbody></table><table class=codebox border=0 cellspacing=0 cellpadding=3 width=500><tbody><tr><td colspan=3 valign=top>module SillyModule</td>
</tr><tr><td colspan=3 valign=top>  def hello</td>
</tr><tr><td colspan=3 valign=top>    "Hi, there!"</td>
</tr><tr><td colspan=3 valign=top>  end</td>
</tr><tr><td colspan=3 valign=top>end</td>
</tr><tr><td valign=top>s.hello</td>
<td valign=top>»</td>
<td valign=top>"Hi, there!"</td>
</tr></tbody></table>

. If multiple modules are included, they are added to the chain in order.

If a module itself includes other modules, a chain of proxy classes will be added to any class that includes that module, one proxy for each module that is directly or indirectly included.

"“Inheritance” and “Mixin Modules”"