I upgraded my Ruby to 2.1.2 & I upgraded Rails to 4.1.2.
I currently have 2 issues that I can't seem to get passed and they may be interconnected.
First, I get this error: Could not find attr_encrypted-1.3.2 in any of the sources when CLEARLY when I run bundle install it says Using attr_encrypted (1.3.2).
Second, before this, I noticed that when I do rails c the version of Ruby is 2.0.0, but ruby --version outputs ruby 2.1.2p95 and rvm lists shows that I am using Ruby 2.1.2. Frustrating, and I think these issues may be interconnected.
bundle install does not fix it. Deleting my Gemfile.lock does not fix it.
Bet its spring again, caching your app.
spring stop
Edit 1
Spring is a rails application preloader. It caches the app, making running rails commands, task, tests etc. faster by saving rails load time. It's default since rails 4.1. Check your bin folder. There will be binstubs within. Open bin/rails and you'll see it loading spring which does the caching magic.
In 99% of the time rails will pick up your code changes. But this won't be the case on changing startup code like gem loading.
Related
I am new to Ruby Development. Now i am working on ruby test-framework code which was working fine with Ruby-1.8.7
Now i want to upgrade ruby for this framework. I have found that test-unit-1.2.3 is included in Ruby-1.8.7 so i have installed it separately with Ruby-2.4.1.
Currently i am facing method missing issue ["register_autorunner"] with this combination. Because these method have not been used in ruby-1.8.7
Can anyone please tell me other changes needed to make this combination [Ruby-2.4.1 , test-unit-1.2.3] working.
Thanks in advance
You should update to TestUnit 3.x, which will have a higher chance of working with Ruby 2.x. Then you need to figure out the changes between Ruby 1.8.7 and Ruby 2.4.1, and how to fix your existing code, which is most likely broken, even after you have fixed/updated your unit test configuration.
Also, consider a switch to Minitest or Rspec, as they are a lot more popular today, so it will be easier to find examples and supporting tools for them. Minitest is also the default test framework used by Ruby on Rails currently.
References:
https://www.jetbrains.com/research/devecosystem-2017/ruby/
http://guides.rubyonrails.org/v5.1/testing.html
I am building rails application using rails 3.2.13 and ruby 2.0.0
I have to use this http://www.pdftron.com/pdfnet/samplecode.html library which support only ruby 1.9.2 , i tried it for ruby 2.0.0 but had no luck. It is working fine with ruby 1.9.3.
I don't want to downgrade to ruby 1.9.3, so is there any way so that I can use this library without downgrading , maybe using Rails Engine or building another Rails::API app in ruby 1.9.3 .
Any help or suggestion ?
If you build a totally different application and then make HTTP API calls from one to the other, you could have the two applications running on different ruby versions. But it would be more performant if you didn't have to go over the network, and of course the cost of maintaining and running 2 applications is more than one.
I managed to Solve this problem by using Java library of PdfNet along with RJB.
I have installed Ruby 2.0.0 and Ruby 1.9.3-p392. But lots of gems, like nokogiri and selenium-webdriver, are not compatible with 2.0, thus I am bound to keep 1.9.3 on my Windows machine. Now the problem is 2.0.0 get rides on 1.9.3. Thus I am not able to run the code which is using the aforementioned gems from my editor Sublime Text 2.
Thus any idea how to keep them both on the same machine without any conflict?
I got couple of sources to do so:
Ruby version manager
Setting the default ruby with Pik
In attempting to upgrade to Bootstrap 2 (using twitter-bootstrap-rails gem), it seems that page-specific scripts are rendered unusable: all scripts must be loaded from the Asset Pipeline to work. Even a simple $ alert function called from a page script tag doesn't appear to load, even if yielded into the head after the AP loads. The original Bootstrap played fine with page scripts.
I understand that scripts should usually be loaded through the AP as a practice, but has anyone else experienced this behavior, and is this something that can be remedied easily, or is this something unique to my setup? (Rails 3.1.3, rvm, ruby 1.9.3, xCode 4.1)
A git reset solved the issue, but I'd rather upgrade and use the new TB features....
Thanks for any insights or thoughts about how to track down the issue.
You are using rails 3.1.3 the new gem works fine for me on rails 3.2.2 so it should be that your jquery-rails gem might not be using the latest jquery. so try upgrading cos the new gem works with the latest version of jquery
keep getting this message in rubyMine
I think the solution here should solve your problem:
Rails 2.x app on RubyMine 3.1
You probably have the rails 2.x gem attached to your RubyMine settings. Go to File > Settings and take a look at Ruby SDK and Gems. Make sure you have rails 3.x selected, and not something else.