Just upgraded to RC1 of RM 3.2 on MacOS Lion and couldn't run the application anymore. Running with rvm. On startup the mysql2 gem reported it couldn't find libmysqlclient.18.dylib on a dlopen.
Solved it. Posting the solution here so it will help somebody save some time.
Using Apple's Property List Editor create an entry in ~/.MacOS/environment.plist call LD_LIBRARY_PATH and set the value to /usr/local/mysql/lib or whereever your MySQL libraries live.
Logout and log back in and RubyMine and the mysql2 gem are happy again.
I got around this by adding this to the environment variables section of the RubyMine server instance.
1) Open Run/Debug Configurations for your server
2) Click on the "..." next to "Environment Variables"
3) Add "DYLD_LIBRARY_PATH" as the key and "/usr/local/mysql/lib/" as value (path from using .dmg MySQL install)
There have been several solutions suggested, but I think the best solution is the last one I suggest:
1) Editing Environment Variables in the Run/Debug Configuration
This works but you have to keep doing for every single configuration, which is a pain. It also doesn't fix the problem if you are running outside of RubyMine.
2) Editing the .MacOS/environment.plist
This seems to not be supported anymore in later versions of OS X.
3) Setting the DYLD_LIBRARY_PATH environment variable in the .profile/.bashrc
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/
This fixed the problem on the console, but RubyMine doesn't seem to load the environment from .profile/.bashrc.
4) Symlink the libmysqlclient.18.dylib into /usr/local/lib
This is what Homebrew typically does, which is to create a symlink for the dylib that cannot be loaded.
ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
You only need to do this once and you're done.. and it works globally, in the console and in RubyMine.
Using Apple's Property List Editor create an entry in ~/.MacOS/environment.plist call LD_LIBRARY_PATH and set the value to /usr/local/mysql/lib or whereever your MySQL libraries live.
Logout and log back in and RubyMine and the mysql2 gem are happy again.
#Aaron Chambers, couldn't add as an answer at that time. Thanks.
Related
OS: Ubuntu 12.04
Go version reporting: 1.1.1
Action:
I have configured the .profile to contain the following lines:
export GOPATH="$HOME/workspace"
export PATH=$PATH:$GOPATH/bin
I have ensured that they are set in the go configuration by running "go env". However when I try to run the command, the screen reports as shown in the image below:
Possible constraining issues:
1) The box originally had Go v1.0 on it and I upgraded it to go version1.1.1, not sure that should mean anything...but if there is some twin configuration madness at work that may explain the fact it's not working despite the path being set.
2) I had the export commands in the .profile file but I see some threads indicate to put it in .bashrc, trying in either still gives the same problem.
Do I need to uninstall go 1.0 ? I just assumed version 1.1.1 would over ride it but that could be wrong. Ideally I wanted to uninstall go entirely and then install version 1.1.2 but I couldn't find anything at golang.org on uninstalling assuming that does solve the problem.
Thanks in advance for any assistance.
As the commenter above stated, you should not use sudo with go get. When you do, you have the root user's environment (which doesn't have your GOPATH) and any files or directories it creates won't be editable by your user. In the past, the go get command would not warn about not having a $GOPATH and so it was easier to get tripped up by this.
To fix your permissions, run the following command to change ownership back to your user:
sudo chown -R "$USER:" "$GOPATH"
You should only ever need to run a plain go get because you can (and should) set your $GOPATH to be a directory you can control. Be sure to read the How To Write Go Code and in particular its discusson on GOPATH.
As the problem described in
Can't run a ruby hello world application in Aptana.
The answer says it is fixed in 3.0.4. But I still got the same error c:\ruby\bin\rubyw.EXE: Permission denied -- C:/ruby/bin (LoadError).
Is there any solution to this problem?
I think the main reason of this problem is cause of your computer security level.
So you need to decrease your security level
OR
①Change your Ruby installed file (eg. Ruby193 folder) to D Drive or other operating system not installed place.
②and copy your URL until bin folder of Ruby change place .
eg.D:\Ruby193\bin
③
and change and paste the URL that you copied to your computer Path of system variables which having at environment variable setting .
My default and current version of ruby is 1.9.3. It's actually the only version that appears when I run rvm list so I don't see how I can be messing that part up. I did follow this
tutorial that I found here, but it just seemed to break everything. I keep getting "No such file or directory" for all the variations of the fix I see, even the in the comments. I am on a Mac, please let me know what other information I need to post here to help you figure out how I'm breaking things.
You can always edit which ruby is used by editing your Build command preferences:
subl ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Ruby/Ruby.sublime-build
Change the default "ruby" to whatever path you require. The version you're using at any given time can be discovered with:
which ruby
Alternatively you can just link to the default which is often located at /opt/local/rvm/bin/ruby.
I am using Aptana Studio 3 and having trouble creating a rails project in the IDE. Aptana tries to create a new rails project using the command rails . instead of rails new .
I used the solution at:
Cannot create a new Rails Project with Aptana Studio 3
involves installing ruby then rails and then Aptana which rectified problem until I updated rails using gem update. This made Aptana repeat the behaviour above and did not create the project although, rails -v shows the expected version. What was shown on the Aptana console was the rails usage help text.
Is there any way to make Aptana use the correct syntax and/or version of rails even after updating the rails version?
I obviously do no wish to go through the whole installation again and believe that there is some configuration setting I am missing.
FYI my configuration details are:
Operating System: Kubuntu 11.10
Ruby version: ruby 1.9.3p0
Rails version: Rails 3.1.3
Aptana IDE: 3.0.6
TIA
nav
It's an issue with environment variables. The Aptana Getting Started Guide mentions that:
You should also make sure that your login PATH is set up correctly
such that you can execute the ruby, gem, rails, and git commands
correctly. Setting these things up in your .bashrc (or equivalent)
isn't sufficient, because it doesn't get evaluated by default when GUI
applications like Aptana Studio 3 get launched.
So the problem must be that Aptana doesn't see the right path and/or environment variables. I have Kubuntu 11.04 64-bits and Kubuntu 11.10 32-bits and the problem shows on both machines using Aptana Studio 3.0.8. How to set the "login PATH" then?
In the Ubuntu family, and any Linux distribution that uses Linux PAM, session-wide environment variables can be set with a .pam_environment file in the home folder. (KDE also offers a way to set session environment variables, but setting a .pam_environment is sufficient).
But only setting the PATH environment variable does not work (I've tried). You must also set GEM_HOME and GEM_PATH.
The .pam_environment file has a very specific syntax. I'm using rvm to install Ruby and Ruby on Rails. So here is my .pam_environment file:
RUBY_VERSION OVERRIDE=ruby-1.9.3-p0
rvm_path DEFAULT=/home/sylvain/.rvm
rvm_bin_path DEFAULT=${rvm_path}/bin
GEM_HOME DEFAULT=${rvm_path}/gems/${RUBY_VERSION}
GEM_PATH DEFAULT=${GEM_HOME}:${GEM_HOME}#global
PATH OVERRIDE=${GEM_HOME}/bin:${GEM_HOME}#global/bin:${rvm_path}/rubies/${RUBY_VERSION}/bin:${rvm_bin_path}:${PATH}
You'll note that even though I'm using rvm, these variables fix a specific version of Ruby and gemset.
You must adapt those values for your own environment. Note that I used variables that rvm sets in .bashrc: RUBY_VERSION, rvm_path and rvm_bin_path. I could have only specified GEM_HOME, GEM_PATH and PATH, but then the result wouldn't have been DRY. ;-) In other words, I would have had to duplicate paths. Note that I didn't use the HOME environment variable, because it doesn't seem to exist outside of the shell.
After rebooting, I've tried creating a Ruby on Rails project, as well as generators (Commands menu > Rails > Call Generate Script with Controller and Model) and it works, at last, when I start Aptana Studio 3 from a desktop shortcut.
And finally, the Getting Started guide states that:
If getting your login PATH set up in this way isn't practical for you,
you can work around the problem by launching Aptana Studio 3 from the
command line, using the studio3 command line utility.
Since opening a console and typing {my_path_to_aptana_studio_3}/studio3 is a hassle, I first tried making a desktop shortcut to "/opt/aptana3/studio3", "konsole -e /opt/aptana3/studio3", or "bash -c /opt/aptana3/studio3"; nothing worked.
So I tried putting an alias in my .bashrc file, so I wouldn't have to type the whole thing from a console everytime: alias aptana="/opt/aptana3/studio3"
It didn't work either. I realized that in order for the command to work, it must be executed from the Aptana folder. So the following worked:
alias aptana="cd /opt/aptana3 ; ./studio3"
UPDATE: The .pam_environment solution does not work for Kubuntu 11.04 64 bits, so I assume it would not work for Ubuntu 11.04 either. However, for Kubuntu, setting session-wide environment variables for GEM_HOME, GEM_PATH and PATH in a shell script in ~/.kde/env works.
Supporting previous #SylvainC's answer publishing my .pam_environment file for rbenv:
RUBY_VERSION OVERRIDE=3.0.0
rbenv_path DEFAULT=/home/#{PAM_USER}/.rbenv
GEM_HOME DEFAULT=${rbenv_path}/versions/${RUBY_VERSION}/lib/ruby/gems/${RUBY_VERSION}
GEM_PATH DEFAULT=/home/#{PAM_USER}/.local/share/gem/ruby/${RUBY_VERSION}:${GEM_HOME}
PATH OVERRIDE=${rbenv_path}/plugins/ruby-build/bin:${rbenv_path}/shims:${rbenv_path}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
I have two related questions that I was hoping someone could help out with.
I recently installed Ruby 1.9.2 on my Mac (running Snow Leopard 10.6.4) and I haven’t been able to figure out how to get Terminal to use the new Ruby as a default, rather than the factory-installed Ruby 1.8.7. The old Ruby 1.8.7 is located in my ~/usr/bin/ruby directory while the new Ruby 1.9.2 is in ~/usr/local/bin/ruby. Someone said that I need to put the new version of Ruby's directory in the PATH prior to the old version's directory so that the system looks there first - is this correct? If so, can anyone provide step by step instructions on how to do this?
I’ve created a new directory but can’t seem to figure out the correct way to add that directory to my PATH using the Terminal bash shell. I tried using the instructions that I found here (http://www.macgasm.net/2008/04/10/ad...thin-terminal/) twice but they didn't work for me. The directory containing my program ("Ruby_Programs") shows up in the PATH but when I try to run "ruby newprogram.rb" from the command line it results in ":ruby: No such file or directory -- newprogram.rb (LoadError)". The file definitely exists and is a functional Ruby program. I did change the name of the directory to "Ruby Programs" and then back to "Ruby_Programs" - could that have somehow caused this problem?
Any help would be greatly appreciated. Here is my current PATH:
$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/sbrriffe/src:/usr/X11/bin:/Users/sbriffe/Ruby_Programs/:
You might want to check out rvm. You can install multiple versions of ruby side by side and easily switch between them. If you follow the rvm installation notes you won't have any more path problems.
Your Ruby Programs directory shouldn't be in your path: the location of your ruby interpreter should be. Then, you cd to the location of your ruby program, and run it from there: ruby program.rb.
Since you are on a Mac, check out homebrew for something that will make installing software easier. I have my homebrew set up in /usr/local, and it works great.
Once you have installed stuff where you need it, then you'll want to adjust your $PATH. The items in $PATH are searched in the order they appear, so in your ~/.bashrc, you'll want to add:
export PATH=/usr/local/bin:$PATH
To make sure /usr/local/bin gets searched before /usr/bin.
I would use RVM to get everything installed, and then once you have RVM installed it is easy to set your default Ruby version.
Check out https://rvm.io/ -- once you have that installed you can change your default by using : $ rvm use 1.9.2 --default
hope that helps- you can do this with any version, not only 1.9.2