Skip to main content

Setup MacOS 10.10 Yosemite Discussion

General • Asked by Chris Oliver

Gravatar

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:~$

Gravatar

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

Gravatar

That I am, but my system Ruby doesn't work:

rvm rubies
ruby-1.9.3-p327 [ missing bin/ruby ]
=* ruby-2.1.1 [ x86_64 ]


Gravatar

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


Gravatar

A comment is error:

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

Shoulde be "postgresql", not "mysql"


Gravatar

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

Gravatar

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

Gravatar

Your more than welcome, you know what I love about this site
" It simply works :) "


Gravatar

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'

Gravatar

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"?

Gravatar

Your SQL server may not be running either just because it wasn't started or because of an error. You'll want to run "brew info mysql" and read the notes for the command to start the server. You can run it manually to see if it starts, and then if that goes well, you can run the launchctl commands to have it start on boot.

Gravatar

I missed the Postgres post-install step where you create the database structure etc. once I did that it was all good. To many terminal tabs open and lost track of what I was doing :)

Gravatar

I think we have all been there more than a few times. ;)


Gravatar

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

Gravatar

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.


Gravatar

Worked a treat for a newbie thanks


Gravatar

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...

Gravatar

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?

Gravatar

Thank you @Chris! Configured successfully


Gravatar

Worked great. Thanks!


Gravatar

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...


Gravatar

How can i install Rails 4 on Mac OS version 10.7.5

Gravatar

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


Gravatar

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


Gravatar

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.


Gravatar

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.

Gravatar

Install the Xcode command line and then try it.

Gravatar

EDIT: fixed it, was mentioned in another comment, just needed to press enter.

Im getting the same error as the above mentioned, I copied these lines into terminal

git config --global color.ui true
git config --global user.name "YOUR NAME"
git config --global user.email "[email protected]"
ssh-keygen -t rsa -C "[email protected]"

and now terminal says

"Enter file in which to save the key (/Users/Home/.ssh/id_rsa):"

Its as if a step is missing above as the next step says now take the key and type in

cat ~/.ssh/id_rsa.pub

before i am able to generate the key am i to save it to a location somewhere?

Gravatar

Yes, but just press Enter to use the default location.

Gravatar

Thanks Chris, I got through to the end and am getting an error

An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling

I seen on another forum someone having this issue but can't seem to get the fix to work, I assume as you've responded to my first question but not my second that your not familiar with this error, I'll try and find more info on it tomorrow, thanks for the guide!.

Gravatar

Sorry, been traveling and missed it I think.

Anytime you get an error that says "Errno::EACCES: Permission denied" usually means that you might have accidentally used "sudo" on one of the commands before. When you use sudo, the files become owned by the root user and that causes problems with the setup.

You can run this command to see what user owns the files and we can see if that's actually the problem:

ls -ls ~/.rbenv | tail -n +2 | tr -s ' ' | cut -d ' ' -f 5

Mine prints out "chris" a bunch of times which is my username.

Gravatar

Hi again Chris,

I Just came back to this thread i didn't expect you to reply so fast thank you so much, I got JSON working by manually adding Sudo command again but then had another issue with the next package, did a little research and although I guess its a little risky I was able to use the sudo -s command to have terminal comply with all requests, so i followed the final steps again but couldn't get localhost:3000 to work. I deleted the Myapp folder and did the Final steps again I did get this message though I'm not sure if it will affect anything - ( ahh its probably because i used the command earlier and its not a part of the myapp folder i deleted)

Keiths-iMac:myapp Home$ rake db:create
myapp_development already exists
myapp_test already exists

When i used "Rails Server" this time i got a better result and now Im able to access localhost:3000, Perseverance has paid off.

Thank you for all you're help you're Wonderful!

Gravatar

Awesome! Once you do it a few times you start to realize what does what and it all starts to make a lot more sense. So don't feel bad having issues so far. :)

Gravatar

[[email protected] moscow_lunch]$ (master) ls -ls ~/.rbenv | tail -n +2 | tr -s ' ' | cut -d ' ' -f 5

staff

staff

staff

why i got staff instead alif ?

Gravatar

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


Gravatar

Great stuff... Even managed after 12 beers

Gravatar

Do not drink and develop ;-)

Gravatar

I guess we develop urine after drinking LOL

Gravatar

As a sysadmin... I sometimes wondered if you guys had been drinking.


Gravatar

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.


Gravatar

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

Gravatar

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.

Gravatar

Thanks. I am trying to figure out my trouble.

Gravatar

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

Gravatar

This worked for me, thank you.


Gravatar

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.


Gravatar

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!

Gravatar

You're welcome!


Gravatar

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

Gravatar

Oops, fixing!


Gravatar

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.


Gravatar

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


Gravatar

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>'


Gravatar

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

Gravatar

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.

Gravatar

Yeah it's up to date. 4.2.1 has no difference in instructions, just a security patched version of 4.2.0.

Did you get XCode installed via the app store? Sometimes you need to restart your terminal to proceed. There's a lot of other information on this issue here: https://github.com/sparklem...

Gravatar

Thanks Chris. Yeah, I restarted XCode and Terminal and then it worked all of a sudden.

Gravatar

That's good to know. I'm curious as to why I've never had that issue, but I guess I'll make a note in there to restart your terminal just in case.


Gravatar

Very Good! Thanks


Gravatar

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


Gravatar

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

Gravatar

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


Gravatar

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


Gravatar

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!

Gravatar

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".

Gravatar

Thanks Chris, will give it a try

Gravatar

You were right, I was using Ruby 2.2.0. Updated to 2.2.1 and it's now working

Gravatar

Awesome! Glad that worked. The error came from trying to install a gem into system ruby. Some people will tell you to use "sudo" to fix it, but that's not fixing the real problem which was that it was using the wrong version of Ruby.

Good rule of thumb is that you should *never* use "sudo" when working with Ruby. It's always a sign you're doing something outside of rbenv and something's configured wrong.

Fingers crossed the rest of your setup goes well!

Gravatar

Hi Chris, it seems like anytime I'm trying to do something with ruby, it tries to get the system ruby and "which ruby" fetches system ruby too. Can you advise how to fix this? A little new to ruby here ;)

Gravatar

The important part is making sure you edited your .bash_profile and added rbenv to your PATH. That will allow it to find the rbenv ruby before the system ruby.

This is the important line from above (after you installed rbenv)

echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

Gravatar

That was there, I figured the global version was wrong :( Thanks a lot though. Great post! Finally a step closer to actually starting some ruby!


Gravatar

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.

Gravatar

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

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


Gravatar

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

Gravatar

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

Gravatar

Perfect! Thanks for the tip!


Gravatar

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.

Gravatar

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.


Gravatar

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?


Gravatar

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.


Gravatar

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!


Gravatar

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...


Gravatar

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


Gravatar
Arjun Mayilvaganan

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

ssh -T [email protected]

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.


Gravatar

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


Gravatar

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?

Gravatar

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"

Gravatar

Hi Chris

This keeps popping up

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

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

How to I allow permissions?


Gravatar

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.


Gravatar

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

Gravatar

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

Gravatar

thank you :) will try it out


Gravatar

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"?

Gravatar

Any idea how to solve this and get PostgresSQL working?

Gravatar

Sounds like your server isn't running. You can run "brew info postgres" to get the instructions for starting the postgres server.


Gravatar

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]
➜ ~

Gravatar

Try restarting your terminal. That usually fixes it.

Gravatar

this fixed it
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc


Gravatar

you the man/woman!

Gravatar

Haha! Thanks :)


Gravatar

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


Gravatar

Thanks, worked.


Gravatar

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


Gravatar

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


Gravatar

Gravatar

This is precisely quality....follow keenly guys


Gravatar

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

Gravatar

Haha! You're welcome. :)


Gravatar

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!


Gravatar

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


Gravatar

awesome time saver


Gravatar

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?

Gravatar

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


Gravatar

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.

Gravatar

Thanks. All fixed.


Gravatar

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.

Gravatar

Can you post your bash_profile file?


Gravatar

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


Gravatar
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'

Gravatar

same issue


Gravatar
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).


Gravatar

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...


Gravatar

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?


Gravatar

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?


Gravatar

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


Gravatar

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...


Gravatar

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


Gravatar

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?


Gravatar
Mithilesh Izardar

I am getting some conflict error


Gravatar

`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.


Gravatar

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$


Gravatar

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????


Gravatar

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


Gravatar

Awesome tutorial....thanks


Gravatar

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


Gravatar

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


Gravatar

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!

Gravatar

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.


Gravatar

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


Gravatar
Katherine Rosenkranz

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


Login or create an account to join the conversation.