asked this on January 24, 2012 02:47
Can I currently use Cloud9 for Ruby on Rails development? Can I run tests, view the equivalent of localhost: etc.
Would be awesome to use with RVM too!
The Cloud9 home page says I can run ruby projects - and it seems to have opened a rails project intelligently, but it doesn't look like I have enough to actually do any real development. Searching the knowledge base for rails gave me 0 results. Running rails s to start the server in the console doesn't seem to have done anything (I guess I need to somehow install rails and all the gems into my cloud9 env or something?) and deploy wants to send it to a real server (ie heroku, joyent....) to run there. Am I missing something - or is just plain and simple not supported right now?
Still have yet to successfully build ruby this way. Has anyone gotten this to work?
What kind of problems have you encountered?
Maybe it works only on premium accounts, but for me it worked on a number of public/private workspaces.
Of course it is a kind of broken way to do things, I think Cloud9 should install ruby1.9 alongside ruby1.8.
I'm currently on a premium account. I have tried this in two workspaces. The script never finishes executing. In some cases, the entire workspace becomes unresponsive.
Without being able to run tests before committing, cloud9 is *not* a viable work environment for ruby projects. 1.8.7 is unacceptably ancient in this regard. If there is only one ruby version installed it should be the current stable release.
Barring that, allowing RVM or something would be acceptable, but I have had less luck with that route.
So, it looks like I was finally able to get this to run on one of my workspaces.
[bm5k@cloud9]:/workspace$ ruby -v # => ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
However, when I try to run bundle install, I get syntax errors for hashes that use the 1.9 syntax, and I am unable to install gems.
sorry about all the white space
I feel your pain. It is obviously wrong way of getting modern Ruby on Cloud9.
To have bundler you need to run:
gem install bundler
And "rm -rf installs", or you will get into file quota error (Cloud9 workspaces allow only 40k files). I modified original script to include these messages.
I've got bundler installed$ bm5k@cloud9]:/workspace$ bundle installGemfile syntax error:/var/lib/stickshift/d86d5144b9ca4dee817614e40e118166/app-root/data/231847/Gemfile:6: syntax error, unexpected ':', expecting $endgem 'best_in_place', git: 'git://github.com/bernat/best_in_place.git'
i run into the same problem when i try to run rspec it threw me this error
FYI, it's working for me: A Rails 3.2.8 app, ran bundle install, and now rake -T shows all my tasks.
I'm not sure how the development process would work here - e.g., there are no databases set up. I guess I could open one up on a server.
It's working for me too, but when I run rails server, it says `permissions denied`.
Probably, binding to 0.0.0.0 is not allowed, but what address to use in this case?
There is new docs available, Rails can be run now!https://docs.c9.io/running_a_rails_app.htmlrails s -b $IP -p $PORT
rails s -b $IP -p $PORT
Running `bundle install` definitely works now. I haven't tried running the server locally in the workspace yet. I have had some luck with using heroku postgres, although it is quite slow.
Anyone know how to get databases working?
Simply running rails:
More rails docs can be found in https://docs.c9.io/running_a_rails_app.html
Same for rails testing and any other server start operations - Just configure your tests to use port $PORT and host $IP
Switch ruby versions:
rvm use 1.9.3 or rvm use 1.8.7
rvm use 1.9.3
rvm use 1.8.7
More on Ruby & RVM support https://docs.c9.io/writing_a_ruby_app.html
For database: You can use sqlite3 (it's already installed on workspaces)
Support Software by Zendesk