Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

final step requires sudo for install of bundler, rails, heroku, tap and pg #12

Closed
durrantm opened this issue Oct 12, 2011 · 15 comments
Closed

Comments

@durrantm
Copy link

I bought a new Mac Air on 10/2/2011
These instructions are very helpful.
An issue that I found is that the last step, running the script to install bundler, rails, heroku, tap and pg fails with permission issues.
So I am running the steps to install the components manually with sudo

Installing Bundler for managing Ruby libraries ...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Installing Rails to write and run web applications ...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Installing the Heroku gem to interact with the http://heroku.com API ...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Installing the Taps gem to push and pull SQL databases between development, staging, and production environments ...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Installing the pg gem to talk to Postgres databases ...
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.

@ntulip
Copy link

ntulip commented Nov 20, 2011

I would love to see if anyone could spend 2 minutes to possibly help fix this. I am getting the same error.

@croaky
Copy link
Contributor

croaky commented Dec 4, 2011

It shouldn't be necessary to sudo. These commands should be run in the context of the rvm'ed Ruby 1.9.2. I'm not sure what the cause of the problem is here.

@ivanovv
Copy link

ivanovv commented Jan 13, 2012

the cause, i think, is this error

Install of ruby-1.9.2-p290 - #complete 

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

@ghost
Copy link

ghost commented Jan 15, 2012

I am having this issue as well

@ivanovv
Copy link

ivanovv commented Jan 15, 2012

@kurtzilla1, do you have Zsh as your shell? I do. Maybe that's the problem, script expects bash shell?

@kelsmj
Copy link

kelsmj commented Jan 15, 2012

I have tried running the laptop script in both bash and zsh...whenever it tries to source the .zshrc it fails. I think this is the root cause, because when it tries to install rails, it thinks it is in hash mode, instead of function mode.

@drapergeek
Copy link
Contributor

I tried running it in zsh as well as bash and ran into the same thing. Any chance that it has something in the thoughtbot dotfiles that it relies on to make this work properly?

@sethvargo
Copy link

This is actually an rvm issue with the new rvm-installer

@hsoi
Copy link

hsoi commented Apr 6, 2012

FWIW, the script mostly runs and just fails when it starts to do the "ruby" portion of things.

In the "ruby" script there is this:

echo "Installing Ruby 1.9.2 stable and making it the default Ruby ..."
  rvm install 1.9.2-p290
  rvm use 1.9.2 --default

and the "use" is the place where it chokes.

I'm running with Xcode 4.3.x installed, so after the script choked I just ran:

bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)'

to ensure I had the right rvm

Because of the Xcode 4.3.x install, I do not have "autoreconf", so I had to get that:

brew install automake

(thankfully, brew was already installed when this "laptop" script ran, so this worked out fine).

then

rvm install 1.9.3 --with-gcc=clang

and

rvm use 1.9.3

In fact, I ensured it was the default

rvm --default 1.9.3

Check the version of ruby, all was good.

Then I just ran the rest of the commands in the "ruby" and "heroku" scripts... the scripts are simple, just a bunch of echo's and "gem" or "heroku" commands. So just ran them all manually.

Seems to be alright.... seems to be.

@glennfu
Copy link

glennfu commented Apr 19, 2012

hsoi's tips seem to have solved the issue for me as well. However I still needed to follow all of the instructions at http://tammersaleh.com/posts/installing-postgresql-for-rails-3-1-on-lion to get postgresql working.

@adarsh
Copy link

adarsh commented May 29, 2012

I also got this to work on Lion using the --with-gcc=clang option and the gcc command line installation (as opposed to full Xcode).

So why not something like this:

echo "Installing Ruby 1.9.2 stable and making it the default Ruby ..."
  #if Lion, then do these
  rvm get head
  rvm install 1.9.3 --with-gcc=clang
  rvm use 1.9.2 --default

  # If not, then...
  rvm install 1.9.2-p290
  rvm use 1.9.2 --default

Were I better at scripting, I would patch this myself. I do know OS X version number is available using defaults read loginwindow SystemVersionStampAsString # => 10.7.4

@durrantm
Copy link
Author

There's a 1.9.3 reference in there, is that intentional? Thx, Michael.

On Tue, May 29, 2012 at 8:18 AM, Adarsh Pandit <
reply@reply.github.com

wrote:

I also got this to work on Lion using the --with-gcc=clang option and
the gcc command line installation (as opposed to full Xcode).

So why not something like this:

echo "Installing Ruby 1.9.2 stable and making it the default Ruby ..."
 #if Lion, then do these
 rvm get head
 rvm install 1.9.3 --with-gcc=clang
 rvm use 1.9.2 --default

 # If not, then...
 rvm install 1.9.2-p290
 rvm use 1.9.2 --default

@adarsh
Copy link

adarsh commented May 29, 2012

Yes, the script should probably be updated re: Ruby version.
1.9.3-p194 is the most recent stable version - rvm install 1.9.3
will pick that up.

@mike-burns
Copy link
Member

These shell actions should only proceed if they succeed. The simple way is to use && at the end of every line, but alternatively:

successfully() {
  $* || (echo "failed" 1>&2 && exit 1)

}

means that we could do

successfully rvm use 1.9.2

croaky pushed a commit that referenced this issue Aug 3, 2012
@croaky
Copy link
Contributor

croaky commented Aug 3, 2012

I believe the option that solves it is --with-gcc=clang. Pushed and closing.

@croaky croaky closed this as completed Aug 3, 2012
ktheory added a commit to ktheory/laptop that referenced this issue Jul 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests