Hot answers tagged

27

Thanks to this thread I found out that the reason it fails to install is because of ... a path pointing the wrong way when the package was compiled. Thankfully the solution is very simple: sudo gem uninstall mysql sudo apt-get install libmysqlclient-dev -y sudo gem install mysql Note: I got an error message trying to uninstall mysql, but that's ...


26

I had the exact same problem when setting up RVM on my new Mac this morning: $ ruby -v dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib Referenced from: /Users/psoshnin/.rvm/rubies/ruby-2.1.3/bin/ruby Reason: image not found To solve the issue I first ran: $ brew update && brew upgrade Then I ran: $ rvm reinstall 2.1.3 --disable-binary ...


20

Famous one – I can haz IP: $ curl icanhazip.com 1.2.3.4 And that's it.


19

I use bash when my primary focus is on file handling. This could include moving, copying, and renaming files, as well as using files as input for other programs or storing other program's output in files. I rarely write bash code that actually examines the contents of a file or generates the output to write to a file; I leave that to the other programs ...


19

Method 1 – railsready If you don't want to do everything manually, you can use the railsready script, which will install for you: An updated system (Linux only) Ruby 1.9.3 latest patch level (installed to /usr/local/bin/ruby) or RVM running 1.9.3 latest patch level Imagemagick libs needed to run Rails (sqlite, mysql, etc) Bundler, Passenger, ...


18

Seeing "Broken pipe" in this situation is rare, but normal. When you run type rvm | head -1, bash executes type rvm in one process, head -1 in another.1 The stdout of type is connected to the "write" end of a pipe, the stdin of head to the "read" end. Both processes run at the same time. The head -1 process reads data from stdin (usually in chunks of 8 ...


18

What you're looking for is called "deduplication". While it's usually implemented by vendors of specialized storage products, the ZFS filesystem implements it as well. Most Unix-derived operating systems can make use of ZFS, and I'd therefore recommend it as the first place to look.


16

Given a problem that both can handle, you'll want to use the one you're most comfortable with. Ultimately, there are a lot of small details, and only experience can teach you to see them. Bash is a general purpose scripting language just like Python, Ruby, Perl, but each has different strengths over the rest. Perl excells at text analysis, Python claims to ...


13

If you use Pacifist then it's possible to just reinstall Ruby. Insert your OS X DVD Run Pacifist Select "Open Apple Install Discs" Select the disc Search "Ruby.framework" Right click and select "Install to Default Location" This will reinstall Ruby, to setup the symlinks from /usr/bin to point to it use Pacifist again: Search "Contents of BSD.pkg" ...


9

You may look on this project: http://rush.heroku.com/


9

TL;DR - use bash only for installing a better language (if it isn't already available), otherwise you're wasting unrecoverable, precious human time. If you can't do it on the command line by hand without mistakes, don't script with bash/shell. It's 2015, so I'd consider the following: memory overhead Ruby/Python runtime memory overhead compared to bash ...


8

You do need a special SMTP server, but you don't need to set it up yourself. As somebody has already suggested, you can create a bogus Gmail account and use the SMTP for that. Or, for really anonymity, you can use a SMTP provider; this will allow you to forge your return address (the same way spammers do) for an extra layer of anonymity and customization ...


8

I'll post the answer here for anyone else having the same trouble. The App Store seems to have killed my Xcode 3.2.2 install without actually installing 4.1 (maybe it would work better with a new version of Xcode installed, or no version at all). The App Store did download an Install Xcode.app file, which I used to complete the install -- it did this ...


8

To download a single gem use (using loudmouth gem as an example): gem fetch loudmouth Fetching: loudmouth-0.2.4.gem (100%) Downloaded loudmouth-0.2.4 to download all gems that your Rails 3 app depends on run: bundle package This will download all gems (and their dependencies) and place them into vendor/cache (without installing them). You can then ...


8

Homebrew does not work out of the box with XCode 4.3. You also need to install the Command Line Tools for Xcode. You can do this by starting XCode and going to Preferences->Downloads->Command Line Tools and click on install. Or get them mannually from https://developer.apple.com/downloads/index.action. Finally I had to call xcode-select -switch ...


8

Normally under Ubuntu you need to do: sudo update-alternatives --config ruby That will allow you to set the default to any available version of ruby installed on your system. This is easily installed from repositories.


8

You can fix a broken pipe at the expense of another process by inserting tail -n +1 in your pipe, like this: type rvm | tail -n +1 | head -1 The +1 tells tail to print the first line of input and everything that follows. Output will be exactly the same as if tail -n +1 wasn't there, but the program is smart enough to check standard output and closes ...


8

Specify the ruby executable for Syntastic Syntastic calls ruby -c to check the syntax of a file, so the errors it shows depends on which version of ruby its using. You can point it to the one you want to use like this: let g:syntastic_ruby_exec = 'path/to/ruby/executable' NOTE: on newer versions of Syntastic: let g:syntastic_ruby_mri_exec = ...


7

You should use apt-get If you care about uninstalling gems with their dependencies. RubyGems will not uninstall unused dependencies. See do-i-have-to-manually-uninstall-all-dependent-gems. If you care about uninstalling gems as a group, rvm is also an option (see below). If that gem would or should install executables in /usr/bin. If you want to upgrade ...


7

I found a way to do it without having to use MacPorts. Thanks to a shell script to Install ImageMagick on Snow Leopard, I was easily able to run the script and have ImageMagick and all of its dependencies installed automatically. First you need to download the script. If you have git installed... cd ~/src git clone ...


7

To hit it every two minutes: while true; do curl yourwebsite.com >/dev/null; sleep 120; done If you want this to run all day and night, use some kind of job-scheduling service like cron (but no while loop, of course).


6

Just delete /System/Library/Frameworks/Ruby.framework, /Library/Ruby, and erb, gem, irb, rdoc, ri, ruby, and testrb from /usr/bin. Warning: OS X expects and sometimes relies on frameworks and software shipped with the system. It would be a very bad idea to remove the system Ruby. It might even get replaced next time you update OS X -- or it might not, but ...


6

The problem is that the commands rvm and rvmsudo are not in your PATH. The PATH is a variable that lists all of the directories that are searched for commands. You need to find out where the rvm and rvmsudo commands are actually located; it could be in /usr/local somewhere or in /opt. If the RVM software was installed in /usr/local I would guess that it ...


6

Use Ruby Version Manager. It was meant for keeping multiple versions of Ruby in the same system, even allowing them to use different Gem sets and configurations. You won't mess with your system's Ruby as well, which is another benefit. All your Rubies will be stored in ~/.rvm/rubies, and therefore separated from the system. There are a few easy steps to get ...


6

This worked for me: brew update && brew install gmp && rvm reinstall 2.1.3


6

This can occur if you install Vagrant in a folder containing spaces. For example, C:\Program Files\HashiCorp\Vagrant instead of the default C:\HashiCorp\Vagrant. Two solutions are available to you: Reinstall Vagrant to a folder without any spaces (eg. the default installation folder) Modify your PATH environmental variable to use the legacy folder ...


6

You can rebuild all your gems with: gem pristine --all Assuming there is no issue with your Ruby or Rubygems installation and only with the gems, you shouldn't need to use rvm at all. If however you need to upgrade your Rubygems, you can try this command to upgrade it to the latest version: rvm rubygems latest


6

As my physics teacher used to say, "It's not as simple as it looks… it's simpler than that." Command arguments – in both Linux and Windows – are space-delimited, and mkdir processes each one separately. So when you run mkdir bin lib lib/NAME test, it creates directories named after each argument, separately. It is basically equivalent to: mkdir bin mkdir ...


5

First, you'll need to create a soft link to the subl command. If you haven't already, create a personal bin directory: mkdir ~/bin then create the soft link: ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl Next, open your .zshrc and add the following to the end: export PATH=$PATH:~/bin Now restart Terminal.app (or ...



Only top voted, non community-wiki answers of a minimum length are eligible