need help installing ruby on rails - ruby-on-rails

I'm installing 1.87.
I got ruby installed and ruby gems
then I tried this from the command prompt: gem install rails
and it gave me this error: http://screencast.com/t/wmBr2b1vC5I
I got the devkit like it suggested and put it in a directory on my desktop but when I went to github for instructions I got lost.
Can someone help guide me step by step? I'm used to PHP and MySQL using WAMP so running things from the command line is new to me.

A lot of gems require native code to be built and linked to as they're being installed. Unfortunately, Windows does not provide any compiling and linking tools, so you have to take one of several routes to enable building native code in Ruby gems.
I've always used Cygwin in the past to accomplish this, but there's also the Ruby Installer which may benefit you more.
Ruby Installer: http://rubyinstaller.org/
You'll probably need to remove your current Ruby install before running the installer, but it should give you everything you need to make installing Rails possible.
If you don't want to use the full installer, you can download "Development Kit", which is part of the installer, to just add the necessary build tools to your command-line environment.
Development Kit: https://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe

Related

Complete Steps Install Ruby on Rails on Windows

Can anyone tell me complete steps install Ruby on Rails 4.2 on Windows (Windows 10)?
I don't know about Windows 10, but we have it working on Windows 7.
Here are the steps on how to do it:
Install Ruby
Install RubyGems
Download & install Rails through RubyGems
Install any third-party dependencies (ImageMagick & MYSQL2 can take some time)
Here are the specifics:
Installing Ruby is the most difficult part on Windows, mainly because you have to compile it before installing.
There are tools which have done this for you, including RubyInstaller and RailsInstaller:
If you're a total newbie, especially to compiling in Windows, you'll want to use one of the above. If you fancy the challenge, you could compile Ruby yourself with Makefile.
--
After you've got Ruby onto your system, you then need to get RubyGems. This should work pretty straightforwardly, although it may be the case that you'll have to play around with your system's settings to get it working properly.
Here is a good tutorial:
RubyGems is simply a way to connect Ruby with any of the "gem" depositories which are available. Gems are basically "plugins" / "libraries" / "dependencies" for your Ruby install, allowing you to call them in applications.
Rails is a gem.
If you therefore want to install Rails, you need to be able to get RubyGems working.
After that, you'll be able to download and install Rails, which can be done as simply as typing gem install rails in your cmd.
--
After that, you'll be able to add extra dependencies to your system, such as ImageMagick or Mysql2 to get Rails working with external resources.
This is the really tricky part on Windows, as since it's built with MinGW32, many of the core components of Ruby/Rails have to be built independently.
Ubuntu/Mac are preferred OS's for many developers simply because they support most dependencies out of the box.

How can I uninstall ruby on rails completely on Windows (installed using RailsInstaller)?

I'm a complete beginner to ruby on rails and am just following a tutorial on Skillshare. I installed rails on Windows 7 following the instruction, but have been having issues.
I'd like to uninstall it completely and start fresh.
I saw some posts related to this, but commands like gem uninstall rails don't work because I'm not sure which folder I should be in when I type in that command.
Also, the tutorial is being done in Mac so I'm having trouble following it exactly.
Please let me know if there's a way to uninstall rails (installed using railsinstaller). Thanks a bunch!
You can uninstall it from Program and Features in Control Panel. After that you can remove the directory to which you installed it. If you didn't change it, then it is C:\Program Files(x86)\Railsinstaller
However, refreshing the software installation is just about the extreme step. What issues are you experiencing? You can comment or add those to your questions.

Running Ruby from usr/bin instead of usr/local/bin?

So I was following the steps on Hivelogic to get ruby on rails setup on my machine. After compiling and installing, I used the which ruby command to double check it installed in the right place. It did not. I was able to install the Rails and MySQL gems though, but both POW and localhost:3000 don't work.
Is there anything wrong with having it in the usr/bin directory instead of usr/local/bin? My usr/local/bin is practically empty, but usr/bin has a ton of files in it.
Edit: I reinstalled ruby to usr/local/bin but now Rails won't install. Is it a problem that it's already installed in usr/bin?
That page is a few years old. The current best practice for Mac and Linux is to use rvm. You can see, even Hivelogic uses rvm now (though I'm not sure how I feel about installing it system wide).
Anything that recommends installing from source as the first option instead of a last-resort fallback is probably bad advice. It's better to install using a package manager like MacPorts or Homebrew both of which have current versions of Ruby 1.8 and 1.9.
MacPorts installs everything in /opt specifically to avoid conflict with system files. From time to time Apple will distribute an update that patches ruby and this can mess up anything you have in the way of dependencies if you've been using a modified /usr/bin/ruby. Generally the system ruby is supposed to be left as-is.
You can replace the "compile ruby" step with an installer like that and save yourself a lot of trouble in the future. Just be sure to have /opt/local/bin as one of the first items in your PATH just as you would for other solutions.
Since installing Ruby and Rails and some kind of database can be a confusing process, it seems like there should be a meta-installer to help you through the process.
So I finally managed to get rails installed in the correct spot. I had to change the line in my .profile to export PATH="/usr/local/bin:$PATH" and then do a sudo gem update --system after installing rubygems before rails could actually be installed.
RVM and Homebrew did not help at all.
EDIT: Since people have a problem with this answer, I'm giving an update. I have since installed RVM and am liking it, but only because I have a friend I ask all my questions to, as RVM is really confusing if you're not used to doing a lot on the command line. I needed help from him to install it because I didn't have any of the bash files, and thought they were hiding somewhere. If you're missing the bash files, just create them yourself. This took a long time to get working, but now I apparently have it setup right.

Install twitter gem on windows7

Trying to setup a windows development machine for a Rails project that has a dependency on the twitter gem.
I get an error when I try and do gem install twitter.
It needs to build native extensions and using --platform=mswin32 didn't work like for other GEMs
Using ubuntu is really not an option. I need the computer I am using for too many other windows things.
You have probably heard this before, but as you get more seriously into ruby stuff, you are going to run into more and more issues running ruby on windows.
That being said, if all you need is to compile, head over to http://rubyinstaller.org and install your ruby through the provided installer. After that is done, hit "Add Ons" off of the main page, and download the dev kit. Extract that in your ruby directory, and you should now be able to build native extensions.

One-Click install for Ruby/Rails/SQLite?

I'm used to the One-Click install local environments of MAMP. Is there a Ruby equivalent... a download that you run and instantly get the most current versions of Ruby, Rails, SQLite running locally?
I'm using a Mac, running Leopard, and am aware that all of the aforementioned technologies ship with Leopard (except maybe SQLite). The books that I have reference newer versions and the last thing I need is to try to retrofit a tutorial to work with my version.
And one more less important question: What are "Gems" and is that something that I need to make sure is fully updated too?
Installation is pretty confusing when you first start with Rails! Even though a lot of what you need is already installed if you are using Mac, personally I found it really hard to find come concise information on how to best go about setting things up.
Since I didn't want anyone else to go through the headaches that I had when configuring their Mac development environment, I've written a 7 step guide to installing Ruby on Rails, MySQL, Apache with PHP, and phpMyAdmin on OSX Leopard. In short, everything you should need to get developing locally on your Mac!
Here's the link:
http://waavoo.com/2009/7-step-guide-installing-ruby-on-rails-mysql-apache-php-phpmyadmin-intel-mac-os-x-leopard/
Hope that helps!
Take a look at FiveRuns Install. It's a free Ruby on Rails stack that you can download.
RubyGems is the Ruby standard for publishing and managing third party libraries. Check out the User Guide.
Have fun!
I have no idea what mac os are you in but Leopard (10.5.x) already have ruby installed, all you need is to updated the gems using
gem update rails
in your command line.
if you're on Tiger (10.4.x) the installation is broken, and please follow this link.
You should also have a look at Phusion Passenger - this, along with the prefpane, allows you to have apache VirtualHosts set up the easy way.
Current versions of Rails are designed to work (for development) without needing an AMP -style stack, by using SQLite and a small Ruby Web server, so if you will only be doing Rails development you don't need to set up a stack - you can just type "rails" and it will work.
BUT the versions of RubyGems and Rails shipped with Leopard are now outdated, though, so you'll need to upgrade these before you go too far. There's an article that I wrote on setting up a Mac for development here, but the minimum commands go like this:
sudo gem install rubygems-update
sudo update_rubygems
sudo update_rubygems (yep, twice)
sudo gem update --system
These get RubyGems up to the current release, so that you can upgrade Rails safely. To do that, type:
gem update rails
The last command doesn't have sudo, because if you omit it, current versions of RubyGems will install a clean copy of the gems into your home directory, leaving the system versions untouched.
Finally, amend the .profile file in your home directory, so that the line with PATH in it says:
export PATH=$HOME/.gem/ruby/1.8/bin:$PATH
Close up any terminal windows for this to take effect. The utilities provided by the gem packages in your home directory will now have precedence over the system versions.
This means that you can type "rails" and the latest version will run, but you haven't messed with any of the software provided by Apple (apart from the system copy of RubyGems).
To upgrade your private copy of Rails whenever a new version comes along in future it's just this again:
gem update rails
just refer this....
http://wiki.rubyonrails.org/getting-started/installation/windows#installing_ruby_on_rails_on_windows
BitNami RubyStack is exactly what you are looking for http://bitnami.org/stack/rubystack

Resources