Capistrano + RVM rvm_install_ruby with Rubinius - rvm

I am trying to fully automate the setup of my deployment host, and so avoiding manual install of Ruby.
I am using capistrano-rvm as it promises to do the job, but I have a problem when RVM compiles Rubinius:
** [out] rbx-2.0.0pre - #configuring
** [out] rbx-2.0.0pre - #compiling
*** [err] Error running '/home/app/.rvm/wrappers/ruby-1.8.7-p358/rake install', please read /home/app/.rvm/log/rbx-2.0.0pre/rake.log
The content of /home/app/.rvm/log/rbx-2.0.0pre/rake.log is:
ERROR: Gem rake is not installed, run `gem install rake` first.
How could I? That should have been done by RVM, no?
Does anyone already met & get out of this issue?
EDIT
I forgot to mention that RVM did load & compile 1.8.7 before rbx, seems like a dependence for build. Maybe RVM is running in a gem set which is badly initialized?

I thought the 2.0.0pre was removed from rbx already, it looks like you have older RVM installation, make sure you update RVM:
curl -L get.rvm.io | bash -s stable --auto
rvm reload
This will run the installer which also makes update.
To make sure everything works properly use rbx-2.0.testing which is supposed to work version of rbx.

Related

cap deploy:migrations fails with Could not locate Gemfile

I'm working on my first rails deployment and having a problem I can't figure out.
mac osx 10.8.2
ruby 1.8.7
Rails 3.2.6
rvm 1.17.2
I've been following this tutorial http://brandnewrails.wordpress.com/ and got stuck on 7c.
I set it all up in RVM, got git running on the server, ran bundle install in the app, and wrote the Capistrano recipe in my_app/config/deploy.rb
Then I ran:
$ capify . no problem
$ cap deploy:setup no errors
$ cap deploy:check returned You appear to have all necessary dependencies installed
$ cap deploy:migrations is where the problem happens. After successfully running a bunch of the commands, capistrano fails. See below:
2012-12-10 00:43:56 executing `bundle_install'
* executing "cd /home/{servername}/party/releases/20121209134354 && bundle install --path vendor/bundle"
servers: ["{servername}"]
[{servername}] executing command
** [out :: {servername}] Could not locate Gemfile
command finished in 694ms
failed: "sh -c 'cd /home/alexchee/party/releases/20121209134354 && bundle install --path vendor/bundle'" on {servername}
Does anyone know what to do? When I check the app directory, the Gemfile is there. Any ideas or further questions?
The inability of capistrano to locate a Gemfile in this case seems to be a symptom of not having initiated git in the app locally, that is on my own computer.
My hunch is that since Gemfile is the first file in the list above, that is why it created an error first. If the program had continued, it would have probably had other errors as well.
Even if git is running on the server and the app is bundled up correctly, you must also initiate git locally and direct it to the appropriate files on your server in order for the deploy to work.
Great instructions are listed here: http://brandnewrails.wordpress.com/2012/10/14/lesson-7b/

Using lessc on Windows

I've been trying to work out how to install lesscss.org on Windows 7 so I can use it from a cygwin command line interface and also using Maven.
We have SASS running in this way but there is a requirement to use LESS in a new project.
My Steps so far...
Checked Ruby is installed, I have it installed at C:\Ruby193
Downloaded the Ruby DevKit and followed this to install it.
At CMD.exe, execute gem install less - 1 gem installed ... less-2.2.1
CMD.exe, run lessc - This gives [WARNING] Please install gem 'therubyracer' to use Less.
So at CMD.exe I try gem install therubyracer which gives this error...
ERROR:
Error installing therubyracer: ERROR: Failed to build gem native extension.
Full error is here
6. And this is where I'm stuck because lessc is still complaining therubyracer is not installed. I've also installed Python27 and added it to the Path variable as that came up in a previous error.
I can confirm I have this path C:\Ruby193\lib\ruby\gems\1.9.1\gems\therubyracer-0.10.1 which looks like a project to me but something is obviously wrong.
I've also found this as a potential answer to getting LESS on Windows but that would indicate we can't get the native 'real' version to run so both Macs, Windows and Ubuntu can use the same switches/ environment? github.com/duncansmart/less.js-windows
As the others mentioned, this is now easily done with node:
npm install -g less
This will install less as a global module that you can use from anywhere on the command line by typing:
lessc input-file.less output-file.css
An even easer way to do this is to just use a tool like SimpleLess that will automagically compile and minify your LESS for you:
http://wearekiss.com/simpless
Happy Coding!
Perhaps you had the same problem I did where you successfully installed the node module via:
npm install -g less
but when trying to run lessc, you were getting the error:
[WARNING] Please install gem 'therubyracer' to use Less.
I think this is because, though you've installed the node module, the lessc command is still tied to the ruby gem. Try uninstalling the less gem:
gem uninstall less
And then try running lessc again.

RVM: Incorrect Ruby version referenced after removal

Just updated the version of Ruby (1.9.2 to 1.9.3) I have installed but now getting the following error when running rake:
$ rake
-bash: /Users/mike.simmonds/.rvm/gems/ruby-1.9.3-p0/bin/rake: /Users/mike.simmonds/.rvm/rubies/ruby-1.9.2-p180/bin/ruby: bad interpreter: No such file or directory
Any tips?
It appears reinstalling the rake gem has fixed it.
looks like a gem pristine task failed and you had older rvm, I have already changed the upgrade code to run upgrade for every gem separately and report you list of failed gems.
It's important to read outputs of rvm, even we try to automate things and make things very easy - sometimes there is not much we can do with the available tools.

Project broken with Bundler errors after RVM install

I installed RVM and installed 3 different rubies: 1.8.7, ree, and 1.9.2.
I have a Rails 3.0.9 project that uses 1.8.7.
Now when I try to run the 3.0.9 project, I get this error:
Could not find xml-simple-1.1.0 in any of the sources
However, the following command:
bundle show xml-simple
yields:
/Users/me/.rvm/gems/ruby-1.8.7-p334/gems/xml-simple-1.1.0
Looks right to me. What am I missing here? The application, when running, is clearly not seeing the right path. Yet Bundler, when run at the command line, sees it just fine. I am not certain where these paths are to be set. I am admittedly new to RVM, I installed it because I want to start a new edge project with 1.9.2.
Thank you for any help you can provide.
I needed to learn how to create a gemset, then switch to that gemset. You can always check your gem and ruby environment with rvm using:
rvm info
That's what clued me in. Once I "use"d the appropriate gemset where the gem was installed, it worked great.

Need help setting up passenger with RVM

I'm trying to setup passenger with rvm. I keep getting this error
Your RVM wrapper scripts are too old.
Please update them first by running
'rvm update --head && rvm reload &&
rvm repair all'.
I did that still same problem
GNU C++ compiler... found at /usr/bin/g++
Curl development headers with SSL support... found
OpenSSL development headers... found
Zlib development headers... found
Ruby development headers... found
OpenSSL support for Ruby... found
RubyGems... found
Your RVM wrapper scripts are too old.
Please update them first by running 'rvm update
--head && rvm reload && rvm repair all'.
I'm using Fedora 14, Ruby 1.9.2, Rails 3.0.7
RVM is installed for multiuser
I also get this error when I do 'passenger start'
Cannot execute
'/home/antarr/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-linux-gcc4.5.1-1002/support/helper-scripts/prespawn
http://0.0.0.0:3000': Permission
denied (13)
I was having the same issue but found that using the rvmsudo command worked. Instead of
sudo passenger-install-apache2-module
try using:
rvmsudo passenger-install-apache2-module
It looks like Passenger 3.0.7 is confused by newer versions of rvm, but it seems like the instructions are incorrect and it's causing trouble. If the GEM_HOME environment variable is not set you get this error.
The correct instructions should be to use your particular version first:
rvm use 1.9.2
Although I got the same error as you, after that it worked for me.
If none of the above solutions work for you and you're getting the GEM_HOME warning
delete everything in .rvmrc
rvm get head && rvm reload && rvm repair all
gem install passenger
passenger-install-apache2-module
copy/paste the end message into your apache.conf
I am still having the same issue with passenger 3.0.19 if I tried to install on gemsets other than default and global. This is soooo troublesome. I have tried many suggestions and even rvm implode, then have everything brand new. but still hitting the brick wall. my forehead almost flatten. Hope not to lose my head!
Luckily, I found myself a fix. I found out that in i am in rvm multiuser envrioment and the issue arised if I switch to user gemset using command: "rvm user gemsets" which basically will create and use .rvm folder in user's home folder. e.g.: /home/.rvm instead of /ur/local/rvm folder. Since I do not know how to switch back and could not find any documention on how to, I did the following steps:
remove .rvm folder in the user home folder,
rm -rf ~username/.rvm
added back the user to rvm group (in multi enviroment, every new user need to be added to rvm group)
sudo usermod -a -G rvm username
re-login.
Now, as long as I am using shared rvm gemset folder, phusion passenger wont complaint.
Hope that helps someone.
I fixed the Permission Denied issue with:
chmod a+x /Users/tvd/.passenger/standalone/3.0.7-x86_64-ruby1.9.2-macosx-10.6/support/helper-scripts/*
Found it in comment section on the phusion.nl blog:
Goto Comment on Phusion Blog