Search Results

Search found 10455 results on 419 pages for 'ruby on rails 3 1'.

Page 75/419 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Using JRuby/Jython for Ruby/Python interoperability?

    - by dbr
    Quite-probably a silly question, as I don't know much about Java/Jython/JRuby/bytecode, but.. I stumbled across _why's unholy again today.. It allows you to output Python bytecode from Ruby code.. Basically allowing them to produce the same bytecode.. Jython outputs Java bytecode, as does JRuby.. Since these both compile to the same bytecode, does this mean you could potentially use any Python library from Ruby, and Ruby libraries from Python?

    Read the article

  • installing ruby 1.9.3 of osx mavricsmavrics

    - by user1648962
    I am trying to install ruby 1.9.3 on my osx 10.9 operating system and I keep getting the following error : Error running 'requirements_osx_port_update_system ruby-1.9.3-p448', please read /Users/ramesh/.rvm/log/1383430694_ruby-1.9.3-p448/update_system.log Requirements installation failed with status: 1. I am using the following command to do the installtion : rvm install 1.9.3 The complete log is as given below : Ramesh:Downloads ramesh$ rvm install 1.9.3 Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p448. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Installing requirements for osx. Updating system............................................................................................................................................................................................................................................................. Error running 'requirements_osx_port_update_system ruby-1.9.3-p448', please read /Users/ramesh/.rvm/log/1383430694_ruby-1.9.3-p448/update_system.log Requirements installation failed with status: 1. Ramesh:Downloads ramesh$ clear

    Read the article

  • Automatic counter in Ruby for each?

    - by yar
    I know you Ruby people will laugh at my bad Ruby code: i=0 for blah in blahs puts i.to_s + " " + blah i+=1 end I want to use a for-each and a counter... is there a better way to do it? Note: I don't know if blahs is an array or a hash, but having to do blahs[i] wouldn't make it much sexier. Also I'd like to know how to write i++ in Ruby. Edit: Technically, Matt's and Squeegy's answer came in first, but I'm giving best answer to paradoja so spread around the points a bit on SO. Also his answer had the note about versions, which is still relevant (as long as my Ubuntu 8.04 is using Ruby 1.8.6). Edit: Should've used puts "#{i} #{blah}" which is a lot more succinct.

    Read the article

  • Advantages/disadvantages of Python and Ruby

    - by Seburdis
    I know this is going to seem a little like all the other python vs ruby question out there, but I'm not looking specifically to pick one over the other all the time. My question is, essentially, why would you use one language over the other when you are starting a new project? What features does ruby have that python doesn't that would make you decide on it for a given project? What about python over ruby? I was just recently thinking about the differentiation between the two languages because of Jamis Buck's "There is no magic, only awesome" series of articles (4 parts, available here) when I realized I really don't know enough about the two languages to know when to choose one over the other. I'm hoping to get objective answers from people who have experience with both languages, rather than just "python is better, ruby sucks" kind of responses. If you know of a feature in one language that doesn't exist in the other and is great in a certain situation, feel free to chime in and say why you think it's awesome. If you have another language comparable to these that you'd like to suggest pros/cons for, like groovy for example, that would be appreciated too. Some thing I know each language has going for it: Ruby: Awesome metaprogramming Great community Wide selection of Gems Rails Great code readability, usually MacRuby is great for native development on Mac without objc Amazing testing tools (cucumber, rspec, shoulda, autotest, etc.) Python: Whitespace indentation List comprehensions Better functional programming support? Lots of support on linux Easy_install isn't far from gems Great variety of libraries available

    Read the article

  • Upgrading Ruby to 1.9

    - by iwan
    Hello, I have ruby v 1.8 installed at C:\Ruby and its gems underneath. I am planning to upgrade to v 1.9 , and it's installer try to default the app to c:\Ruby 1.9 How shall i proceed in order not to break my old gems .. including Rails , etc? Thanks

    Read the article

  • XSLT transformations in Ruby and JRuby

    - by jpatokal
    Simple question: are there any solid XSLT libraries that work in both Ruby and JRuby? REXML works in both, but does not have XSLT support. ruby-xslt doesn't work in JRuby. The latest Nokogiri betas do support JRuby, but the support is still buggy and throws occasional NullPointerExceptions for XML input that works fine in Ruby. (In particular, any transforms that don't result in valid XML cause it to barf, even if xsl:output is set to 'text'!) JXslt is just a wrapper for Java's Xalan/Saxon and doesn't work in Ruby. Please tell me I'm missing something?

    Read the article

  • java.bigDecimal divide in ruby environment

    - by Eyal
    I right script in Ruby that include java classes require 'java' include_class 'java.math.BigDecimal' include_class 'java.math.RoundingMode' during the script I need to divide 2 java.bigDecimal one = BigDecimal.new("1") number1 = BigDecimal.new("3") number1 = one.divide(number1,RoundingMode.new(HALF_EVEN)) since I don't have intellisense in this IDE I'm not sure the syntax is right and the runtime error is: uninitialized constant::HALF_EVEN do I combine java object in the ruby scrpit in the right way? how should I divide two java.bigDecimal object in ruby env?

    Read the article

  • Framework Similar to Pylons for Ruby

    - by Travis
    I've been using Python for most of my web projects lately, and have come to really love the Pylons MVC framework. I like the incredible transparency (lack of magic), the built-in components they selected (sqlalchemy, formencode, routes), and the ability to easily change things up (use a different ORM or templating engine). Moving forward, due to constraints at my company, I'm going to be trying out Ruby rather than Python. I'm wondering if people with experience in both have any recommendations for a Ruby framework that is comparable to Pylons. Python is to Django as Ruby is to Rails Python is to Pylons as Ruby is to ?

    Read the article

  • Calling Python from Ruby

    - by Yktula
    Would it be possible to integrate Python and Ruby with some degree of transparency? I've looked at http://www.goto.info.waseda.ac.jp/~fukusima/ruby/python/doc/ , but it seems rather outdated. Perhaps this is not an appropriate approach, but would it be possible to generate a Ruby interface for Python's C API?

    Read the article

  • Ruby as a scripting language for web server

    - by Olivier Lalonde
    Is it possible to use Ruby as a scripting language with a HTTP server ? I'd like to be able to simply put some Ruby files in a web directory and be able to execute them from my browser - just like I did with PHP. I have absolutely nothing against frameworks such as RoR, but I was told that I should first learn Ruby and only then move on with higher level frameworks. Of course, I could write some Ruby scripts and run them in the console, but I would prefer getting the input/output from my browser :) Is that possible at all ? Otherwise, how hard would it be for me to build a quick and simple web framework ?

    Read the article

  • Ruby and duck typing: design by contract impossible?

    - by davetron5000
    Method signature in Java: public List<String> getFilesIn(List<File> directories) similar one in ruby def get_files_in(directories) In the case of Java, the type system gives me information about what the method expects and delivers. In Ruby's case, I have no clue what I'm supposed to pass in, or what I'll expect to receive. In Java, the object must formally implement the interface. In Ruby, the object being passed in must respond to whatever methods are called in the method defined here. This seems highly problematic: Even with 100% accurate, up-to-date documentation, the Ruby code has to essentially expose its implementation, breaking encapsulation. "OO purity" aside, this would seem to be a maintenance nightmare. The Ruby code gives me no clue what's being returned; I would have to essentially experiment, or read the code to find out what methods the returned object would respond to. Not looking to debate static typing vs duck typing, but looking to understand how you maintain a production system where you have almost no ability to design by contract. Update No one has really addressed the exposure of a method's internal implementation via documentation that this approach requires. Since there are no interfaces, if I'm not expecting a particular type, don't I have to itemize every method I might call so that the caller knows what can be passed in? Or is this just an edge case that doesn't really come up?

    Read the article

  • Ruby character encoding problems in netbeans and command wíndow

    - by salgo60
    I use netbeans as development IDE and runs the application from cmd but have problems to display ISO 8859-1 characters like åäö correct in both cmd window and when I run the application from netbeans Question: What is best practice to set it up Right now I do @output.puts indent + "V" + 132.chr + "lkommen till Ruby Camping!" to get ä My environment chcp 65001 Active code page: 65001 ruby main.rb Source encoding: <Encoding:US-ASCII> Default external: #<Encoding:UTF-8> Default internal: nil Locale charmap: "CP65001" where I have in the code def self.printEncoding puts "Source encoding: #{__ENCODING__.inspect}" if defined? __ENCODING__ if defined? Environment::Encoding puts "Default external: #{Encoding.default_external.inspect}" puts "Default internal: #{Encoding.default_internal.inspect}" puts "Locale charmap: #{ Encoding.locale_charmap.inspect}" end puts "LANG environment variable: #{ENV['LANG'].inspect}" unless ENV['LANG'].nil? end ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

    Read the article

  • Ruby character encoding problems in netabenas and command wíndow

    - by salgo60
    I use netbeans as development IDE and runs the application from cmd but have problems to display ISO 8859-1 characters like åäö correct in both cmd window and when I run the application from netbeans Question: What is best practice to set it up Right now I do @output.puts indent + "V" + 132.chr + "lkommen till Ruby Camping!" to get ä My environment chcp 65001 Active code page: 65001 ruby main.rb Source encoding: <Encoding:US-ASCII> Default external: #<Encoding:UTF-8> Default internal: nil Locale charmap: "CP65001" where I have in the code def self.printEncoding puts "Source encoding: #{__ENCODING__.inspect}" if defined? __ENCODING__ if defined? Environment::Encoding puts "Default external: #{Encoding.default_external.inspect}" puts "Default internal: #{Encoding.default_internal.inspect}" puts "Locale charmap: #{ Encoding.locale_charmap.inspect}" end puts "LANG environment variable: #{ENV['LANG'].inspect}" unless ENV['LANG'].nil? end ruby -v ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

    Read the article

  • Ruby on Rails: Accessing production database data for testing

    - by williamjones
    With Ruby on Rails, is there a way for me to dump my production database into a form that the test part of Rails can access? I'm thinking either a way to turn the production database into fixtures, or else a way to migrate data from the production database into the test database that will not get routinely cleared out by Rails. I'd like to use this data for a variety of tests, but foremost in my mind is using real data with the performance tests, so that I can get a realistic understanding of load times.

    Read the article

  • system call in Ruby

    - by Niklas
    Ruby-help Hi. I'm a beginner in ruby and in programming as well and need help with system call for moving a file from source to destination like this: system(mv "#{@SOURCE_DIR}/#{my_file} #{@DEST_DIR}/#{file}") Is it possible to do this in ruby and which is the correct syntax? Thx

    Read the article

  • Ruby on rails active-record generated SQL on Postgres

    - by jpartogi
    Dear all, Why does Ruby on rails generated more queries in the background on Postgres than MySQL? I haven't tried deploying Rails on production with Postgres yet, but I am just afraid this generated queries would affect the performance. Do you find Rails with Postgres is slower than MySQL, knowing that it produce more query on the background? Or it is relatively the same?

    Read the article

  • What Ruby blog engines are there?

    - by Damian Nowak
    What blog engines written in Ruby do you know? Let's create a list of all Ruby blog engines as a community wiki. I kindly ask to include the following in your answers: blog engine name link to official website link to screenshots or live demo gem install gem-name (if there is one) features, for example: has plugin engine? has themes? has administration panel? anything worth mentioning Not an endorsement, just report the facts. This will make the answers very helpful to visitors. :-) Please mark your answer as a community wiki so that anyone is able to refine the description, add links, etc. It seems noone asked the question before. Found some which aren't the thing I'm really asking for. Ruby CMS/blog: Mephisto vs. Radiant (choosing which is better) Ruby Based Blogging Engine (asking just about rack-enabled blog engines) Blog Engine for Rails Application (limited to Rails)

    Read the article

  • Problems With Eclipse and Ruby Plugin

    - by Jesse J
    I installed Eclipse and then the Ruby Development Tools (RDT), but it would crash when I try to alter certain features, like having line numbers, how far back to have history, and the code coloring scheme didn't work fully. I decided to try to uninstall Eclipse by doing sudo aptitude remove eclipse and then sudo aptitude install eclipse but instead it installed it back with the broken Ruby plugin. I also tried aptitude purge but that didn't help either. How can I freshly reinstall eclipse and get a properly working Ruby plugin?

    Read the article

  • when will ruby 1.8.6 be retired?

    - by Derick Bailey
    I can't seem to find any info on this... when will ruby 1.8.6 be 'retired'? ruby 1.8.7 is much more functional while maintaining syntax compatibility, and ruby 1.9.1 is significantly better all around... any idea when 1.8.6 will be retired?

    Read the article

  • Switching/Linking to another external stylesheet in a .js file using Ruby on Rails

    - by Jake
    Im learning JQuery from a Sitepoint Book but Im trying to apply all the lessons to a Rails App. In one lesson, we are taught how to switch to a different stylesheet if the browser window is resized beyond a certain point. Here's the javascript code: if ($('body').width() > 900) { $('<link rel="stylesheet" href="wide.css" type="text/css" />') .appendTo('head'); } else { $('link[href=wide.css]').remove(); } Rails doesn't seem to want to link to the new stylesheet using 'link rel'. I've tried using the Rails helper: <%= stylesheet_link_tag 'base', :media => 'screen' %> but that doesn't work in a .js file. How do I link to an external stylesheet in a .js file using Ruby? Can I use Ruby on Rails code in a .js file? Thanks.

    Read the article

  • How do I switch Ruby-on-Rails into en-UK

    - by Nick Clarke
    Hi, I'm trying to switch one of my websites into en-UK so that I get the correct date and currency formats etc... I have found this yaml file: http://github.com/mattetti/globalite/blob/master/lang/rails/en-UK.yml Any ideas if there is a better one to use? I also checked here but could not see it: http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale Thanks, Nick

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >