开发者

Install Rails 3 in Windows

I have my ruby environment up and running (got via RubyInstaller). Whenever I try to install rails with the following command:

gem install --http-proxy http://localhost:3128 rails --debug -V

I start getting errors and hence I can't install it:

Exception `NameError' at C:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::InstallCommand
Exception `NameError' at C:/Ruby192/lib/ruby/1.9.1/syck/tag.rb:81 - method `yaml_as' not defined in Module
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubyg开发者_高级运维ems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 -
ERROR:  Loading command: install (Interrupt)

        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/package.rb:92:in `<top (required)>'
        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/format.rb:9:in `<top (required)>'
        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/installer.rb:10:in `<top (required)>'

        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/dependency_installer.rb:3:in `<top (required)>'
        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/commands/install_command.rb:4:in `<top (required)>'
        <internal:lib/rubygems/custom_require>:29:in `require'
        <internal:lib/rubygems/custom_require>:29:in `require'
        C:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:170:in `rescue in load_and_instantiate'

[..]

Can anyone help? Thanks


Leave out the --http-proxy part and try again, i've had multiple issues with that one as well.

Add http_proxy to the System variables in System Properties of Windows in XP: right click on My Computer in Start Menu, then click Advanced -> Environment Variables.


try this: gem install rails -p user@pass:proxy-url

Also look at this

Hope this helps.


This isn't a direct answer to the question, but having tried the approach of things like InstantRails, RubyStack, etc., I've found that these are just an additional layer of things to maintain - and I never really know what's going on under the covers. Further, I have to wait for the project maintainers to issue updates in order to have the latest and greatest. And finally, these by no means represent production environments, which means I have to learn a whole new set of optimizations come production time.

Here are some thoughts / suggestions then:

Are you planning on deploying in a Windows Environment? If not, I would suggest / recommend setting up a Virtual Machine (such as VirtualBox) running Linux (Ubuntu is my preference). You could easily run a RoR + db environment in 512MB or less.

You can then access the filesystem from your Windows box by enabling Samba (for dev purposes) so you can use your favorite Windows IDE tools. To start / stop the server, run migrations etc., just use a Terminal to the instance.

There are many benefits to this approach:

  1. Ruby and Rails is significantly faster on Linux
  2. Assuming this is your target deployment environment, it will be an easy transition from dev to prod
  3. Keeping Ruby and Rails separate from Windows also helps keep your Windows running clean. Lower RAM usage, cleaner disk, and you can turn on / off the RoR instance as needed by starting up / shutting down the VM.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜