I'm trying to install rails on a Mac but am getting some strange errors:
sudo gem install rails
Successfully installed rails-3.2.3
1 gem installed
Installing ri documentation for rails-3.2.3...
file 'lib' not found
Installing RDoc documentation for rails-3.2.3...
file 'lib' not found
rails --version
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Anyone got any ideas what I'm doing wrong?
The solution to this problem seems to have been that I already had an install of rails in /usr/bin which was in my PATH first.
This "install" was simply a shell script which gave the output above saying it's not installed.
I removed this by hand and reinstalled everything - after some messing around fixing random errors that it produced and a small edit to my PATH, it seems to be working now.
Related
I'm going round in circles getting the "Rails is not installed on this system" message in Terminal, yet it tells me I've just installed it.
Simons-MacBook-Pro:~ Simon$ sudo gem install rails
Successfully installed rails-5.0.2
Parsing documentation for rails-5.0.2
Done installing documentation for rails after 0 seconds
1 gem installed
Simons-MacBook-Pro:~ Simon$ rails -v
Rails is not currently installed on this system. To get the latest version,
simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Simons-MacBook-Pro:~ Simon$
Is there somewhere in particular I should be installing it?
Solved it. Found I had another copy in another path. Deleted it and moved it into the same directory where I wanted to create the new app.
$sudo rails where
allowed me to find it.
I've been following this lynda tutorial online on 'Ruby on Rails.' I've downloaded Ruby, devkit and rails on to my computer. After I created sample_app and tried to run bundle install, but it keeps telling me make sure that 'gem install json -v 1.8.2' succeeds before bundling" I try to run gem install json -v 1.8.2 and other variations including "gem install json -v 1.8.2 --verbose", "gem install json --platform=ruby" but everytime I get an error saying that it failed to build gem native extensions. The same thing happened when I was following the downloading devkit tutorial and I tried to install JSON as per its instructions. I've tried using gem update system 2.3.0 but that doesn't work either. What could be wrong?
Typically this will happen on Windows because not all the commands are availible. I would recommended that you either use VirtualBox with an Ubuntu image or use Cloud9 IDE.
I just experienced the same problem myself. I am working my way from Windows to a Mac but not quite there just yet. Windows is ok for Rails development (been doing so for 3 years) although it does present some unique issues occasionally. Check out the following link to downgrade RubyGems to 1.8.29 and then try running bundle install again.
Issue with Ruby gem install
Hopefully this is an easy one - I'm trying to install rails on my netbook. I can#'t seem to get it to update to rails 3 (seems stuck on 2.3.5). Here's some terminal output to show you what I mean...
mike#Ubuntu-Netbook:~$ rails -v
Rails 2.3.5
mike#Ubuntu-Netbook:~$ gem update rails
Updating installed gems
Nothing to update
mike#Ubuntu-Netbook:~$ sudo gem install rails
[sudo] password for mike:
Successfully installed rails-3.1.0
1 gem installed
Installing ri documentation for rails-3.1.0...
file 'lib' not found
Installing RDoc documentation for rails-3.1.0...
file 'lib' not found
mike#Ubuntu-Netbook:~$ rails -v
Rails 2.3.5
See? Stuck at 2.3.5! I have done a whole bunch of rails installs on other machines and never had this problem before - what am I missing?
The 2.3.5 install is completely working.
EDIT: I did not get an answer to this question. I got around it by investigating rvm and installing that way instead.
Are you using bundler? Are you in an rvm gemset?
If you're using the latter, once you sudo, you're in a different user's rvm install, so installation won't be the same. If you're using bundler and have locked rails to 2.3.5, that's what it'll be regardless whether you run gem update or not.
If you can answer the above two questions, we can probably narrow down your issue.
I am trying to install Ruby, RubyGems, and the Ruby on Rails framework so that it will play nicely with my system. I am having issues with my installation. Could somebody help me? Here are the details of my system and how I went about installation.
Currently I am running ubuntu 10.10 using the Linux Kernel 2.6.35-28-generic. My server is Apache 2.2.16 and I use MySQL 5.1.49.
So, I went to my synaptic package manager and selected the following packages to download:
* ruby1.8 – installs Ruby 1.8.4
* libmysql-ruby – additional libraries to access MySQL
* libruby1.8-dbg – debugging library
* ri – Ruby Interactive Reference
* ruby1.8-dev – header files for building extensions
* rails – Ruby On Rails framework
Once that ran successfully, I downloaded rubygems from http://rubyforge.org/projects/rubygems/. Then I unpacked it, got in the terminal, ran a cd to get in the directory of the newly downloaded rubygems directory, and typed 'sudo ruby setup.rb' That ran with no problem and RubyGems 1.8.5 was installed. Then I ran 'sudo gem install rubygems-update' with no problem.
But when I ran 'sudo gem install rails –include-dependencies' I got the following output:
Fetching: activesupport-3.0.8.gem (100%)
Fetching: rails-3.0.8.gem (100%)
Successfully installed activesupport-3.0.8
Successfully installed rails-3.0.8
2 gems installed
Installing ri documentation for activesupport-3.0.8...
Installing ri documentation for rails-3.0.8...
File not found: lib
ERROR: While generating documentation for rails-3.0.8
... MESSAGE: exit
... RDOC args: --ri --op /var/www/testingwww/rubygems-1.8.5/nclude-dependencies/doc/rails-3.0.8/ri lib --title rails-3.0.8 Documentation --quiet
When I run 'rails -v' I get 'Rails 3.0.8' so it seems to have installed despite the error. But when I try to make a rails app by typing 'rails ./helloWorld' I get the manual page for the rails keyword.
I have looked around for two days now on how to fix this issue, but can't seem to figure it out. Does anybody know how to fix this?
Rails 3 requires version 1.8.7 or 1.9.2.
I'd recommend using RVM to manage your Ruby installation and environments. It will really help to get you going quickly and is simple. It's as simple as
curl -L https://get.rvm.io | bash
to install RVM and then rvm install 1.9.2 will get you going.
Have a look at https://rvm.io for more information.
In addition to Matthew's good Answer, I don't know why you're doing rails ./helloWorld. To generate a new app in Rails 3, you should do rails new helloWorld.
If you need a complete guide to getting rolling with Rails under Ubuntu, you can find a short guide here: http://blog.dcxn.com/2011/06/21/rolling-with-rails-3-on-ubuntu-11-04/
The gist is:
Install RVM (The Ruby version manager)
Install Rails from gem
Get going with Rails
It's a simple process but there are a few things you need to do for it to be completely smooth like making sure you have the pre-requisites for rvm installed via apt before install rvm.
Good luck!
I tried to install the new beta on my system with the command:
sudo gem install rails --pre
but no matter what I tried, I still get this damn error:
Successfully installed
rails-3.0.0.beta3 1 gem
installed Installing ri
documentation for
rails-3.0.0.beta3... File not
found: lib
Since I'm very new to ruby, I really don't know what to do.
How can I finish installing this?
Is this installed already?
Why does it abort here?
All you need to run is gem install rdoc, follow its instructions, then run the install rails command again and you're good. The problem is due to rdoc failing to install when installed with rails, if installed manually it works fine.
Source: http://gist.github.com/565967
^ I had the same problem, and this worked for me.
If you're looking to do ruby/rails development on Mac, I'd strongly recommend not using the version of ruby/rubygems shipped with your mac. What I do recommend is:
Installing homebrew and using that to manage software packages on your mac.
Install brewbygems, which makes homebrew play nice with rubygems: gem install brewbygems
Install rvm and learn to love the different versions of ruby and rvm's gemsets feature: gem install rvm
Once you've done that you'll have a pretty robust development environment and you should be able to install any version of rails without a problem. Just keep in mind rails 3 works best using ruby 1.9.2 (install with rvm by running rvm install ruby-head) and is still in beta, meaning it isn't terribly stable and should not be used for anything production grade (yet).
I found the same error message, while after some google I've successfully installed it by manually 'sudo mkdir lib' in the .../gems/rails-3.0.0.beta3. Though it hasn't raised further problem, I hope someone could tell what should be in the missing lib directory.
You don't really need to do this sudo gem install rails --pre, simply sudo gem install rails. Rails3 is the default package now and out of beta.
It should work fine.
Might be a different solution on your OS, but I got the same exact error in Ubuntu and creating a ¨lib¨ folder under the rails gem folder solved my problem. I have explained the solution in the following post:
Installing Rails: "File not found: lib"
For convenience I will copy it here as well. The solution:
mkdir /lib/ruby/gems/1.8/gems/rails-{whatever your version is}/lib
Explanation: The ¨[sudo] gem install rails¨ command expects the /lib folder (at the end) but for some reason it hasn´t been created yet.
The original source of this solution was the following URL. Hope it helps!
http://www.spritle.com/blogs/?p=915
Same problem with beta 4.
The workaround is sudo gem install rails --pre --no-ri --no-rdoc though I don't know why.