I am trying to get my rails environment working on a mac with the latest mac OS. I have ruby installed...
ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin14.0]
When I try to start a rails server I get this message...
rails -s
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.
So I run 'sudo gem install rails' and get ....
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://api.rubygems.org/gems/thread_safe-0.3.4.gem)
How would I get around this error?
DNS issue with rubygems is now resolved so all is well, thanks again Shibi for the status update!
Related
I'm working on a project in ruby 2.1.10. it should be using rails 4.0.13.
I'm using rbenv.
I've installed everything, I believe. I ran bundle install for the project. eventually I got it to run.
However, now I get:
turlingdrome$ rails
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.
turlingdrome$ gem install rails -v 4.0.13
Successfully installed rails-4.0.13
Parsing documentation for rails-4.0.13
Done installing documentation for rails after 1 seconds
1 gem installed
turlingdrome$ which rails
/Users/brianp/.rbenv/shims/rails
turlingdrome$ 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.
turlingdrome$ ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-darwin16.0]
in case it matters, I'm on a mac running 10.12.6
ETA from comment:
turlingdrome$ bundle exec rails -v
Rails 4.0.13
so, bundle exec lets me run rails. rbenv exec rails seems to work too.
So, the problem seems to be in the shim!
Rehash the shims:
rbenv rehash
Now you should be able to run only rails without bundle exec or rbenv exec.
I am currently following the rails guide to create a blog app.
When I run.
ruby -v #ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin16].
I have already ran:
gem install rails
bundle install
I just reached step 4.1, then I ran
bin/rails server
and I am encountering the following error
It's a warning, and not an error. It's clearly suggesting: upgrade to 2.3.1
The server is up and running anyway.
If you are using rvm, rvm install ruby-2.3.1 will do it for you.
I'm trying to install rails to my machine, but keep hitting the same problem, I've installed ruby 2.2.0 and set it via rbenv as global, ruby -v shows correctly
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
but when I try to install rails I get the following error;
$ gem install rails
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
I've read a few places that I shouldn't use sudo gem install rails if I don't know what I'm upto as I could cause issues fumbling around!
My question is should I/can I change my path so I don't have this issue with permissions? If so where?
So I run this command successfully: sudo gem install rails
It outputs: Successfully installed rails-3.0.10
However, whenever I type in rails -v it shows: Rails 1.2.6
How can this be? Whenever I create a new project and do rails server, localhost:3000 doesn't work.
It's likely that your system has rails preinstalled, and the rubygems version is not overriding it.
You might have luck installing rvm and then installing rails within an rvm gemset.
I am trying to get my Instant Rails working on my Windows 7 laptop.
The error I keep getting when trying to access my site files are:
c:/rails/ruby/lib/site_ruby/1.8/rubygems.rb:779:in 'report_activate_error'
RubyGem version error: rack<1.1.0 not~> 1.0.1> <Gem::LoadError>
from c:/rails/ruby/lib/ruby.site_ruby/1.8/rubygems.rb:214:in 'activate'
from c:/rails/ruby/lib/ruby.site_ruby/1.8/rubygems.rb:1082:in 'gem'
from c:/depot/vendor/rails/actionpack/lib/action_controller.rb:34
from c://rails/ruby/lib/ruby.site_ruby/1.8/rubygems/custom_require.rb:31 in 'gem_original_require'
etc...
I have intalled Rubygems 1.3.7 and they work fine and when I run the test it works and the gem env shows that the 1.3.7 has been installed correctly.
What can I do to get this working?
Any prompt help would be VERY appreciated.
Thanks
Your rack gem is outdated. Try to run gem update rack. Or, if you use Rails with Bundler, just run bundle install in the root of your project and it will do everything for you.
I decided to write a little manual about the Ruby 1.8.7 and Rails stable installation.
Download RubyInstaller 1.8.7 from here. During the installation, check the 'Add Ruby executables to your PATH' box. After the installation, don't forget to restard cmd. Then try running ruby -v and gem -v to check for installed Ruby 1.8.7 and RubyGems 1.3.7;
Install the latest stable Rails 2.3.8 using gem install rails --no-ri --no-rdoc; Check it using rails -v;
Create a new application using rails myapp;
Test it: script/server. That's it!
gem install rack -v 1.0.1