New Discussion

Notifications

You’re not receiving notifications from this thread.

Setup MacOS 10.10 Yosemite Discussion

141
General
Christopher Su Christopher Su

When I try to install Homebrew, I get:

csu:~$ ruby -e "$(curl -fsSL https://raw.github.com/Home..."
dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib
Referenced from: /Users/christophersu/.rvm/rubies/ruby-2.1.1/bin/ruby
Reason: image not found
Trace/BPT trap: 5
csu:~$

Looks like you're trying to install with an RVM version of Ruby. https://github.com/Homebrew...

Been struggling to update to Ruby 2.1.2 all day after updating to Yosemite. This worked!! THANKS SO MUCH!!

A comment is error:

# Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Shoulde be "postgresql", not "mysql"

in "brew install rbenv ruby-build" you can add rbenv-gem-rehash and never rehash again :) this is shown in railsgirls but still have to ask Chris if it is any good

Sweeet! I'm going to start using this from now on. Thanks for sharing!

Jitendra Vyas Jitendra Vyas

After yosmite posters has stopped working

/Users/jitendravyas/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `initialize': could not connect to server: No such file or directory (PG::Error)

Is the server running locally and accepting

connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

from /Users/jitendravyas/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.6/lib/active_record/connection_adapters/postgresql_adapter.rb:888:in `new'

Same here:

rake db:create

could not connect to server: No such file or directory

Is the server running locally and accepting

connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Would now be a good time to upgrade to Yosemite if we already have Rails 4 installed on Mavericks?

Yeah, you may run into a few problems, but upgrading Homebrew and possibly a recompile or two and you won't have hardly any troubles. I updated my Macbook Air during the beta and didn't have hardly any trouble.

Worked a treat for a newbie thanks

Yogesh Dishwar Yogesh Dishwar

I am following this guide strictly to install ROR on OS X Yosemite. I have installed ROR successfully but stucked on Configuring GIT. Got error, please help me to go further. Here is the error GIST - https://gist.github.com/tec...

Just press ENTER when it asks you where to save the file instead of typing "cat" and a filename. It will default to the correct location for you. You can then use the "cat" command to grab the public key after it is finished. Make sense?

Worked great. Thanks!

Guillermo Pussetto Guillermo Pussetto

There is one step missing in the "Configuring Git" section.
After adding the key at Github and before testing:

# start the ssh-agent in the background
eval "$(ssh-agent -s)"
# Agent pid 59566
ssh-add ~/.ssh/id_rsa

as described in https://help.github.com/art...

How can i install Rails 4 on Mac OS version 10.7.5

Your best bet is to probably try following these steps. Homebrew should take care of getting everything installed properly for you.

For OS X Yosemite, you may need to remove ~/.rbenv/plugins/ruby-build before 'rbenv install 2.1.5'. See: https://github.com/sstephen...

Great tutorial - thanks.

'gem install rails' took so long I thought it was broken. 'gem install rails -V' is useful as it shows what it's doing. Also, I ended up having to use 'sudo gem install rails -V', but that could just me my setup.

i keep on getting the error "open cat ~/.ssh/id_rsa.pub failed: No such file or directory.

Saving the key failed: cat ~/.ssh/id_rsa.pub." during the "configuring Git" part of the article. I don't know what to do. :(

I feel like I'm missing out on something, did I ever make that directory? Was I supposed to? How was I supposed to? I don't think I missed any steps.

Prateek Kandhari Prateek Kandhari

Install the Xcode command line and then try it.

Keith Greatz Keith Greatz

I had the same issue, was solved by just pressing enter it will auto save to the correct folder.

BenjaminFauchald BenjaminFauchald

Great stuff... Even managed after 12 beers

RonniRasmussen RonniRasmussen

Do not drink and develop ;-)

lol

Hello, Sorry. Place for expert but I am a beginner...
I did the installation of Ruby and Rails but it was a mistake. Please could you tell me how to remove it ? I have no idea... I can not remove anything from my $username.
In advance, many thanks.

CTRL + C !

Hello,
"gem install rails" didn't work without "sudo". When running "$sudo gem install rails", it prompts error message:

ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options...

I appreciate any advice. Thanks

zlib is missing; necessary for building libxml2

Make sure you installed all the dependencies (specifically zlib). Also, you almost never want to use "sudo" with this configuration.

Kirit Vaghela Kirit Vaghela

Try this

sudo env ARCHFLAGS="-arch x86_64" gem install nokogiri -- --use-system-libraries -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.2/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.2/lib --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include

How to completely uninstall Rails all Rails gems from OS so i could start from
zero? sudo gem uninstall rails does not work. I will appreciate any help.

Thank you so much, I really appreciated the guided tour. I'm fairly new working with the backend side of development but your step-by-step got me thru. Cheers!

You're welcome!

"Choose the version of Ruby you want to install" Eh hem. Rails*

Oops, fixing!

Installing Rails
Choose the version of "Ruby" you want to install:
I have no experience in Ruby and i can even see something wrong there.

please can someone advise me on how to update your config/database.yml file to match the database username and password. I'm really new at this. Thank you

facades-MacBook-Air:demo facade$ ruby -v

ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]

facades-MacBook-Air:demo facade$ rails -v

Rails 4.2.0

facades-MacBook-Air:demo facade$ gem -v

2.4.5

facades-MacBook-Air:demo facade$

facades-MacBook-Air:demo facade$ rails server

=> Booting WEBrick

=> Rails 4.2.0 application starting in development on http://localhost:3000

=> Run `rails server -h` for more startup options

=> Ctrl-C to shutdown server

Exiting

/Users/facade/Project/rails/demo/config/environments/development.rb:1:in `<top (required)="">': undefined local variable or method `demo' for main:Object (NameError)

from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'

from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'

from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'

from /Library/Ruby/Gems/2.0.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'

from /Library/Ruby/Gems/2.0.0/gems/railties-4.2.0/lib/rails/engine.rb:598:in `block (2 levels) in <class:engine>'

I got as far as:

gem install rails -v 4.2.0

Then it failed:

ERROR: Error installing rails:
ERROR: Failed to build gem native extension.

/Users/billtubbs/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20150325-2154-64wma0.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
-----
The file "/usr/include/iconv.h" is missing in your build environment,
which means you haven't installed Xcode Command Line Tools properly.

To install Command Line Tools, try running `xcode-select --install` on
terminal and follow the instructions. If it fails, open Xcode.app,
select from the menu "Xcode" - "Open Developer Tool" - "More Developer
Tools" to open the developer site, download the installer for your OS
version and run it.

Tried both these methods and when I ran the command-line install method I get this:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Is this article up to date? There is a Ruby on Rails version 4.2.1 now. Also I'm using OS X 10.10.2 and XCode 6.2. Should I even be following this? Thanks.

Very Good! Thanks

Thanks for the great tutorial. Everything worked perfectly. Thumbs up!

Gem files will remain installed in /Users/winniecheung/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pg-0.18.1 for inspection.

Results logged to /Users/winniecheung/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.1/gem_make.out

An error occurred while installing pg (0.18.1), and Bundler cannot continue.

Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.

but when I try to install pg-v '0.181'

/Users/.rbenv/versions/2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr/local in PATH, mode 040777

ERROR: Error installing pg:

ERROR: Failed to build gem native extension.

/Users/winniecheung/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20150416-11658-1dycw7z.rb extconf.rb

checking for pg_config... no

No pg_config... trying anyway. If building fails, please try again with

--with-pg-config=/path/to/pg_config

checking for libpq-fe.h... no

Can't find the 'libpq-fe.h header

*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of necessary

libraries and/or headers. Check the mkmf.log file for more details. You may

need configuration options.

Provided configuration options:

--with-opt-dir

--without-opt-dir

--with-opt-include

--without-opt-include=${opt-dir}/include

--with-opt-lib

--without-opt-lib=${opt-dir}/lib

--with-make-prog

--without-make-prog

--srcdir=.

--curdir

--ruby=/Users/winniecheung/.rbenv/versions/2.2.1/bin/$(RUBY_BASE_NAME)

--with-pg

--without-pg

--enable-windows-cross

--disable-windows-cross

--with-pg-config

--without-pg-config

--with-pg_config

--without-pg_config

--with-pg-dir

--without-pg-dir

--with-pg-include

--without-pg-include=${pg-dir}/include

--with-pg-lib

--without-pg-lib=${pg-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in /Users/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/pg-0.18.1 for inspection.

Results logged to /Users/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/pg-0.18.1/gem_make.out

Sounds like you didn't insTall Postgres yet. Doing that should fix yOur problem.

Hi,
Could anyone help me out?

I'm getting the following error while installing Rails.

ERROR: While executing gem ... (Errno::EACCES)

Permission denied - /Library/Ruby/Gems/2.0.0/i18n-0.7.0.gem

I got this error while installing rails...

ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/2.0.0/i18n-0.7.0.gem

Can anybody help me out, please? I'm new to this.
Thanks!

It sounds like you aren't using the proper version of Ruby and it's trying to install in your system Ruby. Make sure you didn't miss any commands and try restarting your terminal. When you run "which ruby" you should get something like "/Users/chris/.rbenv/shims/ruby".

Everything works great until I get to the rails portion where I get 'extconf failed, exit code 1'

Any advice? Everything I searched for hasn't helped yet.

Kevin Budd Kevin Budd

was having same problem, found this, https://github.com/sparklem...

specifically, xcode-select --install, in the terminal worked for me to get past error

Is it normal to have Ruby version different to RubyGems version? Here's a screenshot of what I'm talking about:

Yes, Ruby and Rubygems get updated at different times. Everything looks good there but you should upgrade to Rails 4.2.1! :)

Hi, i truly enjoyed the post. Very helpful. Now I have with the installation i get this error

Access denied for user 'root'@'localhost' (using password: YES) . I have a question can a previous installation of MySQL server and Apache server cause conflict with the installation with Ruby on Rails? If not how to solve this problem.

Hey Sarah, if you haven't fixed this yet, the error basically says that your database password doesn't match what was set up with MySQL. If you used homebrew to install it, then the username is usually the same as the user you login as and the password is empty.

I'm having a problem in installing ruby:

1) First I did $ rbenv install 2.2.2, it gave error.

2) Then I did $ sudo rbenv install 2.2.2, it returned:
Installed ruby-2.2.2 to /Users/mavericks/.rbenv/versions/2.2.2

3) Then I did the other one, $ rbenv global 2.2.2, returned “permission denied”. So I did with sudo and it returned no errors.

But now when I do $ ruby -v it returns ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-darwin13.2.0]

And when I do $ rbenv versions it returns:
system
* 2.2.2 (set by /System/Library/Frameworks/Ruby.framework/Versions/.ruby-version)

So, it seems that I have 2.2.2 installed but I doesn't run it when I try to through rbenv.
Anybody can help me?

I get this error message during the rails installation step, after pasting the command "gem install rails -v 4.2.1" in terminal:

Error installing rails:

invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/avinash/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/cache/activesupport-4.2.1.gem

Help appreciated.

Keith Greatz Keith Greatz

Edit - After a little perseverance all is now working as you have explained, amazing how one little deviation from the original instructions can cause issues, thanks for the guide Chris!

If you have issues when first connecting to your local psql service ("psql: FATAL: database “<user>” does not exist"), try this : http://stackoverflow.com/qu...

When I type "launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist" I have an error: "/Users/admin/Library/LaunchAgents/homebrew.mxcl.postgresql.plist: Not a directory". Thanks for help

Arjun Mayilvaganan Arjun Mayilvaganan

Actually I had Git configured before following these steps itself. So, just to test the working, i tried,

ssh -T git@github.com

But, the output was, "Permission denied (publickey)"

So, tried configured again exactly as per the steps above and the result didn't change.
But, I have been using GitHub without any problem before on my mac.
Does this output affect my use of Ruby on Rails?
Please help. :)
Thanks In Advance.

Help!? don't know how to fix this, I run this command:
gem install rails -v 4.2.1

Hey everyone,

Bit of help needed:

ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory

How do i fix?

Looks like you may not be using the Ruby (and the gem command) from the rbenv install. Try restarting your terminal and making sure you get something like "/Users/chris/.rbenv/shims/ruby" from running "which ruby"

When i say rails new App, it gives sortof an error saying Install missing gem with bundle install. how exactly do i fix this problem ?

Do i do run the command bundle install ?

Thanks in advance.

i am using ZSH instead of BASH. Will the above still work? i see a lot of commands have bash in them.

Yep they should! I use ZSH too, but it supports almost the exact same syntax.

I am getting the following error when i try to install PostregSQL and try and access it

➜ ~ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Any idea how to solve this and get PostgresSQL working?

Trying to install Ruby but i am getting the following and it is not setting the default one.

➜ ~ rbenv install 2.2.2
Downloading ruby-2.2.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudf...
Installing ruby-2.2.2...
Installed ruby-2.2.2 to /Users/harshamv/.rbenv/versions/2.2.2

➜ ~ rbenv global 2.2.2
➜ ~ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
➜ ~

Try restarting your terminal. That usually fixes it.

you the man/woman!

Haha! Thanks :)

kumar immanuel kumar immanuel

Its helped me a lot...
thank you bro...:)

Thanks, worked.

Hi bonjour, j'ai un gros soucis depuis plusieurs jours

rbenv install 2.2.2

Downloading ruby-2.2.2.tar.gz...

-> https://dqw8nmjcqpjn7.cloud...

Installing ruby-2.2.2...

BUILD FAILED (OS X 10.10.4 using ruby-build 20150719-13-g86919c8)

Inspect or clean up the working tree at /var/folders/ss/d0nmwmf15v36d2zhlxwr60180000gp/T/ruby-build.20150730105944.34973

Results logged to /var/folders/ss/d0nmwmf15v36d2zhlxwr60180000gp/T/ruby-build.20150730105944.34973.log

Last 10 log lines:

To eliminate this warning, please install libyaml and reinstall your ruby.

The Ruby yaml extension was not compiled.

ERROR: Ruby install aborted due to missing extensions

Configure options used:

--prefix=/Users/drak/.rbenv/versions/2.2.2

--with-openssl-dir=/usr/local/opt/openssl

CC=clang

CFLAGS= -O3 -Wno-error=shorten-64-to-32

LDFLAGS=-L/Users/drak/.rbenv/versions/2.2.2/lib

CPPFLAGS=-I/Users/drak/.rbenv/versions/2.2.2/include

Hi i have a problem when i try to install rebind install 2.2.2

rbenv install 2.2.2

Downloading ruby-2.2.2.tar.gz...

-> https://dqw8nmjcqpjn7.cloud...

Installing ruby-2.2.2...

BUILD FAILED (OS X 10.10.4 using ruby-build 20150719-13-g86919c8)

Inspect or clean up the working tree at /var/folders/ss/d0nmwmf15v36d2zhlxwr60180000gp/T/ruby-build.20150730105944.34973

Results logged to /var/folders/ss/d0nmwmf15v36d2zhlxwr60180000gp/T/ruby-build.20150730105944.34973.log

Last 10 log lines:

To eliminate this warning, please install libyaml and reinstall your ruby.

The Ruby yaml extension was not compiled.

ERROR: Ruby install aborted due to missing extensions

Configure options used:

--prefix=/Users/drak/.rbenv/versions/2.2.2

--with-openssl-dir=/usr/local/opt/openssl

CC=clang

CFLAGS= -O3 -Wno-error=shorten-64-to-32

LDFLAGS=-L/Users/drak/.rbenv/versions/2.2.2/lib

CPPFLAGS=-I/Users/drak/.rbenv/versions/2.2.2/include

someone can help me please

mark

This is precisely quality....follow keenly guys

Ryan Pytleski Ryan Pytleski

Removed because the author helped me fix using twitter, this is a top notch service lol :)

Haha! You're welcome. :)

I keep getting a bunch of errors and I think it's because I used Sudo, but I'm not sure how to fix it. I followed this, but I'm getting the error about permission denied for postgres.

ERROR: While executing gem ... (Gem::FilePermissionError)

You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

Which I saw in other comments could be because I didn't write the one part correctly and it's using the system ruby, but I redid it multiple times to make sure it was correct (deleting the previous ones to make sure there were no issues).

I deleted everything out of my .bash_profile and redid it and I made sure it was exactly as typed but I'm getting this error sometimes: line 1: syntax error near unexpected token `source'

When I type in "rbenv global" I get 2.2.2 but when I type in ruby -v I get 2.0.0 because it's using the system ruby even after restarting the terminal.

I saw the one comment about typing in: ls -ls ~/.rbenv | tail -n +2 | tr -s ' ' | cut -d ' ' -f 5 to see who owns rbenv and I get "staff" printed out a bunch (which is obviously a problem because that is not my username)

Any ideas how I can fix this botched install for a Mac newbie? Thank you!

VINUTHA REDDY B VINUTHA REDDY B

Can you please share the installation Setup Ruby On Rails on Windows 8

awesome time saver

Everything worked like a charm until...

# Create the database
rake db:create

Then I got this error...

Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Should install mysql2?

This fixed it:

gem install mysql2

bundle install

Then I updated gemfile with....

gem 'mysql2', '~> 0.3.18'

Apparently mysql2 isn't still compatible with newer version of rails because rails 4.2.4 is pretty new. Hence running 0.3.18

rake db:create

Hello, while installing nokogiri the following error occurs:

ERROR: Error installing nokogiri:

invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/ddovgal/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/cache/nokogiri-1.6.6.2.gem

any ideas for Mac Yosi? Thanks in advance.

Thanks. All fixed.

Hello. I'm going though the install process and whenever I run the ~/.bash_profile command, I receive the following error:

-bash: eval: line 1: syntax error near unexpected token `)'
-bash: eval: line 1: ` init -)'

I've gone over the steps and I cannot figure what I'm doing incorrectly.

Can you post your bash_profile file?

ruby 2.2.2 and rails 4.2.4 installation works on 10.11 too. thank you!

Bryan Frederick Kelley Galindo Bryan Frederick Kelley Galindo

im having this error, i don't know what i did wrong if someone could help me please

Gem::LoadError (Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).):

activerecord (4.2.4) lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec'

activerecord (4.2.4) lib/active_record/connection_adapters/connection_specification.rb:174:in `spec'

activerecord (4.2.4) lib/active_record/connection_handling.rb:50:in `establish_connection'

activerecord (4.2.4) lib/active_record/railtie.rb:120:in `block (2 levels) in <class:railtie>'

activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'

activesupport (4.2.4) lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'

Ningchuan Li Ningchuan Li

same issue

Bryan Frederick Kelley Galindo Bryan Frederick Kelley Galindo

this is another error i cant fix help please
Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Aurovrata Venet Aurovrata Venet

Very good notes, I got stuck trying to intsall rails due to libxml2 being already installed on my machine...so had to google some compile flags.(http://stackoverflow.com/qu...

rake db:create gives the error, Could not find json-1.8.3 in any of the sources

Run `bundle install` to install missing gems.. I included json-1.8.3 in gemfile, and then did bundle install. After that gem list json gives --

*** LOCAL GEMS ***

json (1.8.1)

then rake db:create fails again with the same error. What should I do?

Dillon Wernicki Dillon Wernicki

have tried installing a few different ways and always end up with the error : .rbenv/versions/2.2.3/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo': getaddrinfo: nodename nor servname provided, or not known (SocketError)
(on El Capitan) Any thoughts?

Great!!

Thanks a lot for very very well guidance.
For some reasons to install ssh key, please refer also this: https://help.github.com/art....
This guidance is 98 out of 100 point...

Thanks again.
Nyoman, Bali, Indonesia

I Installed Rails With No Problem, But Now It Disappears. Why?

I followed the guidance carefully and I successfully installed: Homebrew, Ruby, Git, Rails, and Setting Up Database.

I tried them by creating some testing apps with no problem, I went to bed, and left my computer on for downloading Xcode.

But the next morning, when wanted to practice using them, I found rails is no longer in my computer. Here is what it says:

ings-Mac:~ ing$ ruby -v

ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15]

ings-Mac:~ ing$ rails -v

Rails is not currently installed on this system. To get the latest version, simply type:

$ sudo gem install rails

NOTE:

I made another installation of rails with:

$ sudo gem install rails (with no problem)

It installed Rails 4.2.5.

I made some testing with and without mysql. It DONE WELL.

Will rails disappear again? Let see...

Oh yeh, there are similar problems in Stackoverflow...

thanks for this! New computer, quickest I've ever set up!

On running the command rake db:create getting following message.

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"myapp_development"}

Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost", "database"=>"myapp_test"}

rake aborted!

Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded. Add `gem 'mysql2'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).

Gem::LoadError: can't activate mysql2 (~> 0.3.13), already activated mysql2-0.4.2. Make sure all dependencies are added to Gemfile.

Tasks: TOP => db:create

(See full trace by running task with --trace)

Any suggestions?

Mithilesh Izardar Mithilesh Izardar

I am getting some conflict error

Nicholas Blasgen Nicholas Blasgen

`sudo brew upgrade --HEAD ruby-build`

Turns out I already had an outdated version, so I had to upgrade in order to make anything work. As the upgrade has no downside, I suggest adding it to the article just to ensure that the person is running the most recent version.

Subrotho Bagchi Subrotho Bagchi

I am getting this error after this step
\Subratha$echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
\Subratha$source ~/.bash_profile
-bash: rbrenv: command not found
\Subratha$ source ~/.bash_profile
-bash: rbrenv: command not found
\Subratha$~/.bash_profile
-bash: /Users/tinabagchi/.bash_profile: Permission denied
\Subratha$

Subrotho Bagchi Subrotho Bagchi

please help I am stuck after this command
$ source ~/.bash_profile
says command not found

I tried
$~/.bash_profile

says $ -bash: /Users/tinabagchi/.bash_profile: Permission denied

What can I do????

Nicholas Tillman Nicholas Tillman

Got build failed error when trying to install 2.2.3 with rbenv. Any suggestions?

Awesome tutorial....thanks

natasha kelly natasha kelly

Hello, I know this post is extremely old but I just attempted to download the packages. I ran into trouble with the git conversion and the PostreSQL install. Please advise

best article on the net for this!!! Thank you Railsgirls...

Jessica Pamanian Jessica Pamanian

I tried installing Ruby on Rails through Railsbridge Installfest, got very stuck and found this site instead. I was able to view my new website, however in order to do so I had to overwrite a bunch of stuff: .gitignore, Gemfile, bin/rails, bin/rake, config/secrets.yml, config/database.yml. I'm very new to this and have no real clue what I've done and fear that in the future rails won't work and that it will have something to do with this.

What did I do? Is this good or bad? Thank you!

As long as you followed all these instructions you should be fine. It sounds like you overwrote files inside a Rails app which should be fine. You can always try creating a new Rails app and seeing if that works. Then you'll know you're setup correctly.

Paul Dumanig Paul Dumanig

I got this error all the time:

ERROR: Error installing rails:
invalid gem: package content (data.tar.gz) is missing in /Users/paul/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/cache/rack-1.4.7.gem

Katherine Rosenkranz Katherine Rosenkranz

thank you! I don't know why the rest of the internet can't be so helpful

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 88,834+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.